mirror of
https://github.com/troglobit/finit.git
synced 2026-11-29 21:08:21 +00: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:
1 parent
87f9b94b42
commit
b1d57d6828
1 file changed
+8
-5
@@ -116,18 +116,21 @@ int conf_parse_runlevels(char *runlevels)
|
|||||||
void conf_parse_events(svc_t *svc, char *events)
|
void conf_parse_events(svc_t *svc, char *events)
|
||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
char *ptr = events;
|
char *ptr;
|
||||||
|
|
||||||
if (!events)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!svc) {
|
if (!svc) {
|
||||||
_e("Invalid service pointer");
|
_e("Invalid service pointer");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* First character must be '!' if SIGHUP is not supported. */
|
/* By default we assume UNIX daemons support SIGHUP */
|
||||||
svc->sighup = 1;
|
svc->sighup = 1;
|
||||||
|
|
||||||
|
if (!events)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* First character must be '!' if SIGHUP is not supported. */
|
||||||
|
ptr = events;
|
||||||
if (ptr[i] == '!') {
|
if (ptr[i] == '!') {
|
||||||
svc->sighup = 0;
|
svc->sighup = 0;
|
||||||
ptr++;
|
ptr++;
|
||||||
|
|||||||
Reference in new issue
Block a user