From d20a586734214f8d107921fdcbc6c646b5ae197e Mon Sep 17 00:00:00 2001 From: Thomas Kerpe Date: Wed, 5 Jun 2019 14:35:25 +0200 Subject: [PATCH] Prevent zombie apocalypse by ignoring SIGCHLD Fixes Issue #369 --- include/util/command.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/util/command.hpp b/include/util/command.hpp index aa3271f9..ca10718b 100644 --- a/include/util/command.hpp +++ b/include/util/command.hpp @@ -90,6 +90,8 @@ inline int32_t forkExec(std::string cmd) { setpgid(pid, pid); execl("/bin/sh", "sh", "-c", cmd.c_str(), (char*)0); exit(0); + } else { + signal(SIGCHLD,SIG_IGN); } return pid;