From 1b7c69ac84227937886cd665e140032616bb300a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Fri, 27 Aug 2021 22:52:28 -0300 Subject: [PATCH] wait.h: fix wait_exitcode macro. Apparently a mistake from copy pasting. This was hiding the actual exit codes (usually became only 0), so much of the logic around detecting return codes from children was wrong. This includes runit and stage 2: runsvdir exiting due to a signal or crash should have prompted runit to try and start stage 2 anew; instead, it was just proceeding with the poweroff sequence. --- src/wait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wait.h b/src/wait.h index d294e9d..974b0af 100644 --- a/src/wait.h +++ b/src/wait.h @@ -9,7 +9,7 @@ extern int wait_stop(); extern int wait_stopnohang(); #define wait_crashed(w) ((w) & 127) -#define wait_exitcode(w) ((w) >> 8) +#define wait_exitcode(w) ((w) & 255) #define wait_stopsig(w) ((w) >> 8) #define wait_stopped(w) (((w) & 127) == 127)