X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=slip.c;h=3f7935a008ad16e483a3aaee72af8795b033147a;hb=6b30affc1ec14bf38a73994e8fdd39f26b5bccb3;hp=1a60f40f64490f89f3b6533a55116b3d93d50b7e;hpb=ee697dd98d0f9aca6b9df7ffb32d3a15b4e33d6d;p=secnet.git diff --git a/slip.c b/slip.c index 1a60f40..3f7935a 100644 --- a/slip.c +++ b/slip.c @@ -230,20 +230,13 @@ static void userv_userv_callback(void *sst, pid_t pid, int status) "(expected %d)\n",pid,st->pid); return; } - if (!st->expecting_userv_exit) { - if (WIFEXITED(status)) { - fatal("%s: userv exited unexpectedly with status %d", - st->slip.nl.name,WEXITSTATUS(status)); - } else if (WIFSIGNALED(status)) { - fatal("%s: userv exited unexpectedly: uncaught signal %d", - st->slip.nl.name,WTERMSIG(status)); - } else { - fatal("%s: userv stopped unexpectedly", - st->slip.nl.name); - } + if (!(st->expecting_userv_exit && + (!status || + (WIFSIGNALED(status) && WTERMSIG(status)==SIGTERM)))) { + lg_exitstatus(0,st->slip.nl.name,0, + st->expecting_userv_exit ? M_WARNING : M_FATAL, + status,"userv"); } - Message(M_WARNING,"%s: userv subprocess died with status %d\n", - st->slip.nl.name,WEXITSTATUS(status)); st->pid=0; } @@ -391,7 +384,7 @@ static void userv_phase_hook(void *sst, uint32_t newphase) if (newphase==PHASE_RUN) { userv_invoke_userv(st); /* Register for poll() */ - register_for_poll(st, userv_beforepoll, userv_afterpoll, 2, + register_for_poll(st, userv_beforepoll, userv_afterpoll, st->slip.nl.name); } if (newphase==PHASE_SHUTDOWN) {