From b81af6ef42a9f559731d99c0d65ca5505fb6f910 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 17 Nov 2020 21:44:37 +0000 Subject: bugfix: s6-permafailon *also* did not init the sigset >.> --- src/supervision/s6-permafailon.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/supervision/s6-permafailon.c b/src/supervision/s6-permafailon.c index 6c012be..1a9d68e 100644 --- a/src/supervision/s6-permafailon.c +++ b/src/supervision/s6-permafailon.c @@ -3,20 +3,24 @@ #include #include #include + #include #include #include #include #include #include + #include #define USAGE "s6-permafailon seconds deathcount statuslist prog..." #define dieusage() strerr_dieusage(100, USAGE) -static void list_scan (char const *s, unsigned char *codes, sigset_t *sigs) +static inline void list_scan (char const *s, unsigned char *codes, sigset_t *sigs) { size_t pos = 0 ; + memset(codes, 0, 32) ; + sigemptyset(sigs) ; while (s[pos]) { unsigned int u ; @@ -57,7 +61,7 @@ static void list_scan (char const *s, unsigned char *codes, sigset_t *sigs) int main (int argc, char const *const *argv, char const *const *envp) { - unsigned char codes[32] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" ; + unsigned char codes[32] ; sigset_t sigs ; unsigned int total, seconds, n ; struct stat st ; -- cgit v1.2.3