Ticket #46536: qprocess-nozombies.patch
File qprocess-nozombies.patch, 756 bytes (added by RJVB (René Bertin), 10 years ago) |
---|
-
qtbase/src/corelib/io/qprocess_unix.cpp
1312 1312 processManager()->remove(q); 1313 1313 } 1314 1314 1315 //https://codereview.qt-project.org/#/c/61294/ 1315 1316 bool QProcessPrivate::waitForDeadChild() 1316 1317 { 1317 1318 Q_Q(QProcess); 1318 1319 1319 1320 // read a byte from the death pipe 1320 1321 char c; 1321 q t_safe_read(deathPipe[0], &c, 1);1322 qint64 readcount = qt_safe_read(deathPipe[0], &c, 1); 1322 1323 1323 1324 // check if our process is dead 1324 1325 int exitStatus; 1325 if (qt_safe_waitpid(pid_t(pid), &exitStatus, WNOHANG) > 0) {1326 if (qt_safe_waitpid(pid_t(pid), &exitStatus, readcount > 0 ? WNOHANG : 0) > 0) { 1326 1327 processManager()->remove(q); 1327 1328 crashed = !WIFEXITED(exitStatus); 1328 1329 exitCode = WEXITSTATUS(exitStatus);