Set default value for svc->sighup, even if service has no event mask

The `initctl reload <JOB>` 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 <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2015-11-22 10:05:57 +01:00
parent 87f9b94b42
commit b1d57d6828
+8 -5
View File
@@ -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++;