Skip to content

Commit 676c4c3

Browse files
authored
Merge pull request #36 from A-dead-pixel/zombies-PR
Reap leftover zombie processes
2 parents 76a3c6d + d5c0c8d commit 676c4c3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/executor/Executor.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ void Executor::executeParent() {
190190
for (auto& listener: eventListeners_) {
191191
listener->onPostExecute();
192192
}
193+
// This is needed, as most earlier waits have the WNOWAIT flag.
194+
withErrnoCheck(
195+
"final waitpid failed: ", {ECHILD}, waitpid, -1, nullptr, WNOHANG);
193196
}
194197

195198
void Executor::setupSignalHandling() {

0 commit comments

Comments
 (0)