]> andersk Git - moira.git/commitdiff
Catch children (i.e. spawned DCM's) and print their status if non-zero
authormar <mar>
Wed, 3 Aug 1988 19:00:25 +0000 (19:00 +0000)
committermar <mar>
Wed, 3 Aug 1988 19:00:25 +0000 (19:00 +0000)
server/mr_main.c

index cfd30febd311f87b60aefde22139c3b58a47cf9f..09c09b38bdf009593d645f5d87530d55d169e4fb 100644 (file)
@@ -20,6 +20,7 @@ static char *rcsid_sms_main_c = "$Header$";
 #include <strings.h>
 #include <sys/errno.h>
 #include <sys/signal.h>
+#include <sys/wait.h>
 #include "sms_server.h"
 
 extern CONNECTION newconn, listencon;
@@ -50,6 +51,7 @@ extern void do_client();
 extern int sigshut();
 void clist_append();
 void oplist_append();
+void reapchild();
 
 extern time_t now;
 
@@ -430,3 +432,18 @@ oplist_delete(oplp, op)
        }
        abort();
 }
+
+
+void reapchild()
+{
+    union wait status;
+    int pid;
+
+    while ((pid = wait3(&status, WNOHANG, (struct rusage *)0)) > 0) {
+       if  (status.w_termsig == 0 && status.w_retcode == 0)
+         com_err(whoami, 0, "dcm started successfully");
+       else
+         com_err(whoami, 0, "%d: startdcm exits with signal %d status %d",
+                 pid, status.w_termsig, status.w_retcode);
+    }
+}
This page took 0.066307 seconds and 5 git commands to generate.