mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
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:
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user