diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2022-12-05 01:28:41 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2022-12-05 01:28:41 +0000 |
commit | cac30eda3f3dbb3c690715df5b2867d22b1fc497 (patch) | |
tree | 11e79858775a823babaedbe60dfe51425ad4b243 /src/supervision/s6-svwait.c | |
parent | 40aff8c8e78c4e83325dcbfc3fa5f99ed7321a2f (diff) | |
download | s6-cac30eda3f3dbb3c690715df5b2867d22b1fc497.tar.xz |
s6-svwait shouldn't exit early on supervisor death
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/supervision/s6-svwait.c')
-rw-r--r-- | src/supervision/s6-svwait.c | 8 |
1 files changed, 3 insertions, 5 deletions
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 ; } |