qt5base-lts/tests/auto/corelib/io/qprocess
Thiago Macieira 3ccfc351fd QProcess: Handle spurious socket notifications for stdout and stderr
On Unix systems where the GUI event dispatcher uses a notification
system for socket notifiers that is out of band compared to select(),
it's possible for the QSocketNotifier to activate after the pipe has
been read from. When that happened, the ioctl(2) call with FIONREAD
might return 0 bytes available, which we interpreted to mean EOF.

Instead of doing that, always try to read at least one byte and examine
the returned byte count from read(2). If it returns 0, that's a real
EOF; if it returns -1 EWOULDBLOCK, we simply ignore the situation.

That's the case on OS X: the Cocoa event dispatcher uses CFSocket to get
notifications and those use kevent (and, apparently, an auxiliary
thread) instead of an in-thread select() or poll(). That means the event
loop would activate the QSocketNotifier even though there is nothing to
be read.

Task-number: QTBUG-39488
Change-Id: I1a58b5b1db7a47034fb36a78a005ebff96290efb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-06-12 17:54:11 +02:00
..
fileWriterProcess Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
test QProcess: Handle spurious socket notifications for stdout and stderr 2014-06-12 17:54:11 +02:00
testBatFiles Moving relevant tests to corelib/io 2011-08-31 10:08:38 +02:00
testDetached Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
testExitCodes Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
testForwarding add QProcess::InputChannelMode 2013-09-05 21:17:44 +02:00
testGuiProcess Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
testProcessCrash Make the null pointer dereference a volatile one 2013-01-29 01:47:01 +01:00
testProcessDeadWhileReading Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
testProcessEcho Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
testProcessEcho2 Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
testProcessEcho3 Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
testProcessEchoGui Whitespace cleanup: remove trailing whitespace 2013-03-16 20:22:50 +01:00
testProcessEnvironment Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
testProcessEOF Replace win32-g++ with mingw scope 2014-01-17 12:08:24 +01:00
testProcessNormal qprocess autotests don't need QtGui 2013-02-09 18:44:41 +01:00
testProcessOutput qprocess autotests don't need QtGui 2013-02-09 18:44:41 +01:00
testProcessSpacesArgs qprocess autotests don't need QtGui 2013-02-09 18:44:41 +01:00
testSetNamedPipeHandleState QProcess/Win: allow child processes to change modes of the stdin pipe 2013-12-10 18:36:25 +01:00
testSetWorkingDirectory qprocess autotests don't need QtGui 2013-02-09 18:44:41 +01:00
testSoftExit Whitespace cleanup: remove trailing whitespace 2013-03-16 20:22:50 +01:00
testSpaceInName qprocess autotests don't need QtGui 2013-02-09 18:44:41 +01:00
.gitignore test: Moving tst_QProcess::echoTest_performance() 2012-10-19 02:43:05 +02:00
qprocess.pri add and use qtHaveModule() function 2012-12-21 19:05:02 +01:00
qprocess.pro QProcess/Win: allow child processes to change modes of the stdin pipe 2013-12-10 18:36:25 +01:00
tst_qprocess.cpp QProcess: Handle spurious socket notifications for stdout and stderr 2014-06-12 17:54:11 +02:00