X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/blobdiff_plain/de56407f0fd27d5366a936b872972630f1683f0f..6143ee87f637f8262260d5d8001722f22a54bde4:/update/exec_002.c diff --git a/update/exec_002.c b/update/exec_002.c index 4f4d06c4..c65b3ab5 100644 --- a/update/exec_002.c +++ b/update/exec_002.c @@ -9,6 +9,7 @@ static char *rcsid_exec_002_c = "$Header$"; #include #include +#include #include "gdb.h" #include "update.h" #include "sms_update_int.h" @@ -23,15 +24,17 @@ exec_002(str) char *str; { union wait waitb; - int n, pid; + int n, pid, mask; str += 8; while (*str == ' ') str++; + mask = sigblock(sigmask(SIGCHLD)); pid = fork(); switch (pid) { case -1: n = errno; + sigsetmask(mask); log_priority = log_ERROR; com_err(whoami, errno, ": can't fork to run install script"); code = send_object(conn, (char *)&n, INTEGER_T); @@ -41,6 +44,7 @@ exec_002(str) case 0: execlp(str, str, (char *)NULL); n = errno; + sigsetmask(mask); log_priority = log_ERROR; com_err(whoami, n, ": %s", str); (void) send_object(conn, (char *)&n, INTEGER_T); @@ -49,6 +53,7 @@ exec_002(str) do { n = wait(&waitb); } while (n != -1 && n != pid); + sigsetmask(mask); if (waitb.w_status) { log_priority = log_ERROR; com_err(whoami, 0, "child exited with status %d", waitb.w_status);