summaryrefslogtreecommitdiff
path: root/src/supervision/s6-svwait.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-03-02 12:09:48 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-03-02 12:09:48 +0000
commit1747a0f5142f0c36a61b37786368f05bcb3060f3 (patch)
tree513ca73e83f6d9bdc39784d3c0f085c418f24720 /src/supervision/s6-svwait.c
parentfa342a6615c39c1760a41011f713f696d1eb5c33 (diff)
downloads6-1747a0f5142f0c36a61b37786368f05bcb3060f3.tar.xz
Make s6-svwait et al. exit instead of hang if s6-supervise dies
Diffstat (limited to 'src/supervision/s6-svwait.c')
-rw-r--r--src/supervision/s6-svwait.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/supervision/s6-svwait.c b/src/supervision/s6-svwait.c
index 28d1c3d..f2bd34c 100644
--- a/src/supervision/s6-svwait.c
+++ b/src/supervision/s6-svwait.c
@@ -52,7 +52,8 @@ int main (int argc, char const *const *argv)
unsigned char readystate[bitarray_div8(argc)] ;
s6_svlisten_init(argc, argv, &foo, ids, upstate, readystate, &deadline) ;
e = s6_svlisten_loop(&foo, wantup, wantready, or, &deadline, -1, 0) ;
- if (e) strerr_dief1x(e, "some services reported permanent failure") ;
+ if (e < 0) strerr_dief1x(102, "supervisor died") ;
+ else if (e > 0) strerr_dief1x(e, "some services reported permanent failure") ;
}
return 0 ;
}