From cac30eda3f3dbb3c690715df5b2867d22b1fc497 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 5 Dec 2022 01:28:41 +0000 Subject: s6-svwait shouldn't exit early on supervisor death Signed-off-by: Laurent Bercot --- src/supervision/s6-svwait.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/supervision/s6-svwait.c') diff --git a/src/supervision/s6-svwait.c b/src/supervision/s6-svwait.c index 3633bd1..2c7a312 100644 --- a/src/supervision/s6-svwait.c +++ b/src/supervision/s6-svwait.c @@ -51,7 +51,7 @@ int main (int argc, char const *const *argv) { s6_svlisten_t foo = S6_SVLISTEN_ZERO ; - int e ; + unsigned int e ; uint16_t ids[argc] ; unsigned char upstate[bitarray_div8(argc)] ; unsigned char readystate[bitarray_div8(argc)] ; @@ -61,12 +61,10 @@ int main (int argc, char const *const *argv) { wantup = 1 ; e = s6_svlisten_loop(&foo, 0, 0, 0, &deadline, -1, 0) ; - if (e < 0) strerr_dief1x(102, "supervisor died") ; - else if (e > 0) strerr_dief1x(e, "some services reported permanent failure") ; + if (e) strerr_dief1x(e, "some services reported permanent failure or their supervisor died") ; } e = s6_svlisten_loop(&foo, wantup, wantready, or, &deadline, -1, 0) ; - if (e < 0) strerr_dief1x(102, "supervisor died") ; - else if (e > 0) strerr_dief1x(e, "some services reported permanent failure") ; + if (e) strerr_dief1x(e, "some services reported permanent failure or their supervisor died") ; } return 0 ; } -- cgit v1.3.1