Browse Source

Merge pull request #7 from salanki/master

Add signal handler to avoid zombies in non-wait mode
zorun 6 years ago
parent
commit
3640941052
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/load.cc

+ 6 - 0
src/load.cc

@@ -1,3 +1,4 @@
+#include <signal.h>
 #include <hooks/hooks.h>
 
 #include "logger.h"
@@ -39,6 +40,11 @@ int load(LibraryHandle& handle) {
        script_wait = wait->boolValue();
     }
 
+     /* Install signal handler for non-wait case to avoid leaving  zombie processes around */
+     if (!script_wait) {
+        signal(SIGCHLD, SIG_IGN);
+     }
+
     return 0;
 }