Ticket #46496: qprocess-nozombies.patch
File qprocess-nozombies.patch, 833 bytes (added by RJVB (René Bertin), 10 years ago) |
---|
-
qtbase/src/corelib/io/
old new 1320 1320 processManager()->remove(q); 1321 1321 } 1322 1322 1323 //https://codereview.qt-project.org/#/c/61294/ 1323 1324 bool QProcessPrivate::waitForDeadChild() 1324 1325 { 1325 1326 Q_Q(QProcess); 1326 1327 1327 1328 // read a byte from the death pipe 1328 1329 char c; 1329 q t_safe_read(deathPipe[0], &c, 1);1330 qint64 readcount = qt_safe_read(deathPipe[0], &c, 1); 1330 1331 1331 1332 // check if our process is dead 1332 1333 int exitStatus; 1333 if (qt_safe_waitpid(pid_t(pid), &exitStatus, WNOHANG) > 0) {1334 if (qt_safe_waitpid(pid_t(pid), &exitStatus, readcount > 0 ? WNOHANG : 0) > 0) { 1334 1335 processManager()->remove(q); 1335 1336 crashed = !WIFEXITED(exitStatus); 1336 1337 exitCode = WEXITSTATUS(exitStatus);