From 005a8bfbf0022f03dafafcf2b5c438ccf0675a49 Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Fri, 18 Mar 2016 12:53:12 -0400 Subject: Remove QPROCESS_USE_SPAWN and all that it surrounds The spawn code was only used to make QProcess work on QNX 6.5.0. Fork works on QNX 6.6.0. The QNX spawn implementation has a flaw that causes a deadlock in certain situations. When a working directory is specified for the process, the QNX spawn implementation stops all threads except the one doing the spawn so that it can temporarily change the process' working directory. This can lead to a deadlock if the thread does anything that conficts with something being done in a stopped thread. QNX 6.5.0 is no longer supported in Qt 5.6.0 so we can just switch QNX to the fork implementation and get rid of the spawn implementation. Made a QNX specific adjustment to the hardExit test. There's a bug in the OS that the test can run into because it does something that normal applications wouldn't. Task-number: QTBUG-47250 Change-Id: Ib32567d2c15ce651815858000035ac5aa6f35224 Reviewed-by: Dan Cape Reviewed-by: Oswald Buddenhagen Reviewed-by: Rafael Roquetto --- src/corelib/io/qprocess.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/corelib/io/qprocess.cpp') diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 952116b9db..a86e3cb438 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1134,17 +1134,6 @@ bool QProcessPrivate::_q_processDied() if (crashed) { exitStatus = QProcess::CrashExit; setErrorAndEmit(QProcess::Crashed); - } else { -#ifdef QPROCESS_USE_SPAWN - // if we're using posix_spawn, waitForStarted always succeeds. - // POSIX documents that the sub-process launched by posix_spawn will exit with code - // 127 if anything prevents the target program from starting. - // http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html - if (exitStatus == QProcess::NormalExit && exitCode == 127) { - setError(QProcess::FailedToStart, - QProcess::tr("Process failed to start (spawned process exited with code 127)")); - } -#endif } bool wasRunning = (processState == QProcess::Running); -- cgit v1.2.3