QProcess/Win: do not treat all negative exit codes as crash

Only exit codes that are likely to be in the range of
EXCEPTION_* and STATUS_* codes are treated as crash.

Task-number: QTBUG-28735

Change-Id: I36ae6dc4be28df0c6b6b7361df2c2d0203ee7919
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Joerg Bornemann 2013-03-01 16:15:56 +01:00 committed by The Qt Project
parent 92f59be2b4
commit 7ec521a373

View File

@ -795,8 +795,8 @@ void QProcessPrivate::findExitCode()
DWORD theExitCode;
if (GetExitCodeProcess(pid->hProcess, &theExitCode)) {
exitCode = theExitCode;
//### for now we assume a crash if exit code is less than -1 or the magic number
crashed = (exitCode == 0xf291 || (int)exitCode < 0);
crashed = (exitCode == 0xf291 // our magic number, see killProcess
|| (theExitCode >= 0x80000000 && theExitCode < 0xD0000000));
}
}