]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MONITOR/AliChildProcTerminator.cxx
Fixed SOR-EOR handling in reconstruction server.
[u/mrichter/AliRoot.git] / MONITOR / AliChildProcTerminator.cxx
index 1b58a4db36619f898725a0c9dd143bd53a08d8e5..5593d4d3d440d22887d44227f9a32d287e0cf418 100644 (file)
@@ -10,6 +10,7 @@
 #include "AliChildProcTerminator.h"
 
 #include <sys/wait.h>
+#include <signal.h>
 
 //______________________________________________________________________________
 // Full description of AliChildProcTerminator
@@ -32,6 +33,15 @@ AliChildProcTerminator::AliChildProcTerminator()
   sac.sa_handler = sig_handler;
   sigemptyset(&sac.sa_mask);
   sac.sa_flags = 0;
+  
+  // The sa_restorer field is Not POSIX and obsolete.
+  // This is for compilation on other systems
+#if defined(__linux) && \
+    (defined(__i386__) || defined(__x86_64__)) && \
+     defined(__GNUC__)
+  sac.sa_restorer= NULL;
+#endif
+  
   sigaction(SIGCHLD, &sac, 0);
 }
 
@@ -44,6 +54,8 @@ void AliChildProcTerminator::sig_handler(int /*sig*/)
 
 void AliChildProcTerminator::ChildProcTerm(Int_t pid, Int_t status)
 {
+  if (pid < 0) return;
+
    Long_t args[2];
    args[0] = (Long_t) pid;
    args[1] = (Long_t) status;