From 7ec521a373b03782b4ef364cb92427283187c78e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 1 Mar 2013 16:15:56 +0100 Subject: [PATCH] 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 Reviewed-by: Friedemann Kleint Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess_win.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index 693778e6298..0fec8e4738f 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -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)); } }