diff --git a/plugins/pidfile.c b/plugins/pidfile.c index 073f47c5..330b4a7d 100644 --- a/plugins/pidfile.c +++ b/plugins/pidfile.c @@ -46,7 +46,7 @@ static char *mkcond(char *buf, size_t len, char *nm) static void pidfile_callback(void *arg, int fd, int events) { static char ev_buf[8 *(sizeof(struct inotify_event) + NAME_MAX + 1) + 1]; - static char cond[MAX_ARG_LEN]; + static char cond[MAX_COND_LEN]; struct inotify_event *ev; ssize_t sz, len; @@ -94,7 +94,7 @@ static void pidfile_callback(void *arg, int fd, int events) */ static void pidfile_reconf(void *_null) { - static char cond[MAX_ARG_LEN]; + static char cond[MAX_COND_LEN]; svc_t *svc; (void)(_null); int restart = 0; diff --git a/src/svc.h b/src/svc.h index 791a6ee9..c055de37 100644 --- a/src/svc.h +++ b/src/svc.h @@ -68,6 +68,7 @@ typedef enum { #define FINIT_SHM_ID 0x494E4954 /* "INIT", see ascii(7) */ #define MAX_ARG_LEN 64 #define MAX_STR_LEN 64 +#define MAX_COND_LEN (MAX_ARG_LEN * 3) #define MAX_USER_LEN 16 #define MAX_NUM_FDS 64 /* Max number of I/O plugins */ #define MAX_NUM_SVC 64 /* Enough? */ @@ -94,7 +95,7 @@ typedef struct svc { int runlevels; int sighup; /* This service supports SIGHUP :) */ svc_block_t block; /* Reason that this service is currently stopped */ - char cond[MAX_ARG_LEN]; + char cond[MAX_COND_LEN]; /* Incremented for each restart by service monitor. */ const unsigned int restart_counter;