chiark / gitweb /
slip: Report unexpected kinds of death from userv
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 6 Oct 2014 23:39:04 +0000 (00:39 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 8 Oct 2014 17:25:18 +0000 (18:25 +0100)
If st->expecting_userv_exit, we are expecting userv to exit 0 or die
with SIGTERM.  If anything else happens, we should at least log it.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
slip.c

diff --git a/slip.c b/slip.c
index 59978c98d87ea5a5704595d675532d4b87320d43..3f7935a008ad16e483a3aaee72af8795b033147a 100644 (file)
--- a/slip.c
+++ b/slip.c
@@ -230,7 +230,9 @@ 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 (!(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");