diff options
-rw-r--r-- | src/Program.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Program.cpp b/src/Program.cpp index d9927af..33f5cd0 100644 --- a/src/Program.cpp +++ b/src/Program.cpp @@ -217,8 +217,6 @@ int exec_program_async(const char **args, pid_t *result_process_id) { setsid(); signal(SIGHUP, SIG_IGN); - // TODO: Still creates zombie??? find a fix! - // Daemonize child to make the parent the init process which will reap the zombie child pid_t second_child = fork(); if(second_child == 0) { // child @@ -232,6 +230,8 @@ int exec_program_async(const char **args, pid_t *result_process_id) { } else { /* parent */ if(result_process_id) *result_process_id = pid; + + waitpid(pid, nullptr, 0); } return 0; } |