Merge pull request #2629 from andresilva/custom-fix-zombie-processes
custom: reap zombie processes on terminationpull/2595/head
commit
7dfc72003f
|
@ -112,6 +112,10 @@ inline FILE* open(const std::string& cmd, int& pid) {
|
|||
execlp("/bin/sh", "sh", "-c", cmd.c_str(), (char*)0);
|
||||
exit(0);
|
||||
} else {
|
||||
reap_mtx.lock();
|
||||
reap.push_back(child_pid);
|
||||
reap_mtx.unlock();
|
||||
|
||||
::close(fd[1]);
|
||||
}
|
||||
pid = child_pid;
|
||||
|
|
Loading…
Reference in New Issue