Ticket #46238: qprocess-nozombies.patch
File qprocess-nozombies.patch, 819 bytes (added by RJVB (René Bertin), 10 years ago) |
---|
-
qprocess_unix.cpp
old new 1296 1296 processManager()->remove(q); 1297 1297 } 1298 1298 1299 //https://codereview.qt-project.org/#/c/61294/ 1299 1300 bool QProcessPrivate::waitForDeadChild() 1300 1301 { 1301 1302 Q_Q(QProcess); 1302 1303 1303 1304 // read a byte from the death pipe 1304 1305 char c; 1305 q t_safe_read(deathPipe[0], &c, 1);1306 qint64 readcount = qt_safe_read(deathPipe[0], &c, 1); 1306 1307 1307 1308 // check if our process is dead 1308 1309 int exitStatus; 1309 if (qt_safe_waitpid(pid_t(pid), &exitStatus, WNOHANG) > 0) {1310 if (qt_safe_waitpid(pid_t(pid), &exitStatus, readcount > 0 ? WNOHANG : 0) > 0) { 1310 1311 processManager()->remove(q); 1311 1312 crashed = !WIFEXITED(exitStatus); 1312 1313 exitCode = WEXITSTATUS(exitStatus);