mirror of
https://github.com/sheumann/hush.git
synced 2024-12-21 23:29:34 +00:00
runsvdir: straighten some convoluted code. logic is unchanged
This commit is contained in:
parent
9f2f808b0d
commit
3b35fbb632
@ -377,19 +377,17 @@ int runsvdir_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (bb_got_signal) {
|
if (bb_got_signal == SIGHUP) {
|
||||||
case SIGHUP:
|
|
||||||
for (i = 0; i < svnum; i++)
|
for (i = 0; i < svnum; i++)
|
||||||
if (sv[i].pid)
|
if (sv[i].pid)
|
||||||
kill(sv[i].pid, SIGTERM);
|
kill(sv[i].pid, SIGTERM);
|
||||||
/* Fall through */
|
|
||||||
default: /* SIGTERM (or SIGUSRn if we are init) */
|
|
||||||
/* Exit unless we are init */
|
|
||||||
if (getpid() == 1)
|
|
||||||
break;
|
|
||||||
return (SIGHUP == bb_got_signal) ? 111 : EXIT_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
/* SIGHUP or SIGTERM (or SIGUSRn if we are init) */
|
||||||
|
/* Exit unless we are init */
|
||||||
|
if (getpid() != 1)
|
||||||
|
return (SIGHUP == bb_got_signal) ? 111 : EXIT_SUCCESS;
|
||||||
|
|
||||||
|
/* init continues to monitor services forever */
|
||||||
bb_got_signal = 0;
|
bb_got_signal = 0;
|
||||||
} /* for (;;) */
|
} /* for (;;) */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user