summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-11-17 21:44:37 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-11-17 21:44:37 +0000
commitb81af6ef42a9f559731d99c0d65ca5505fb6f910 (patch)
tree853a88ffd5827b2b9b0d2e48e821f1d314a26e22 /src
parent1d18c381b68851ec63450f8199c4380157422f42 (diff)
downloads6-b81af6ef42a9f559731d99c0d65ca5505fb6f910.tar.xz
bugfix: s6-permafailon *also* did not init the sigset >.>
Diffstat (limited to 'src')
-rw-r--r--src/supervision/s6-permafailon.c8
1 files 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 <sys/stat.h>
#include <string.h>
#include <signal.h>
+
#include <skalibs/types.h>
#include <skalibs/strerr2.h>
#include <skalibs/bitarray.h>
#include <skalibs/sig.h>
#include <skalibs/tai.h>
#include <skalibs/djbunix.h>
+
#include <s6/s6-supervise.h>
#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 ;