From b1d57d682844f8dad025bed45bdb6a0fadf25dd7 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sun, 22 Nov 2015 10:05:57 +0100 Subject: [PATCH] Set default value for svc->sighup, even if service has no event mask The `initctl reload ` command did not work properly. This was due to the service not being properly initialized to default settings when reading the Finit configuration file. Signed-off-by: Joachim Nilsson --- conf.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/conf.c b/conf.c index 2a5d5190..9b2a3101 100644 --- a/conf.c +++ b/conf.c @@ -116,18 +116,21 @@ int conf_parse_runlevels(char *runlevels) void conf_parse_events(svc_t *svc, char *events) { size_t i = 0; - char *ptr = events; - - if (!events) - return; + char *ptr; if (!svc) { _e("Invalid service pointer"); return; } - /* First character must be '!' if SIGHUP is not supported. */ + /* By default we assume UNIX daemons support SIGHUP */ svc->sighup = 1; + + if (!events) + return; + + /* First character must be '!' if SIGHUP is not supported. */ + ptr = events; if (ptr[i] == '!') { svc->sighup = 0; ptr++;