summaryrefslogtreecommitdiff
path: root/src/supervision
diff options
context:
space:
mode:
Diffstat (limited to 'src/supervision')
-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 ;