init: fix compile breakage with '# CONFIG_FEATURE_KILL_REMOVED is not set'
runsvdir.c: fix typo in comment
This commit is contained in:
32
init/init.c
32
init/init.c
@ -668,7 +668,7 @@ static void run_shutdown_and_kill_processes(void)
|
|||||||
* it to happen even somewhere inside "sysinit" would be a bit awkward.
|
* it to happen even somewhere inside "sysinit" would be a bit awkward.
|
||||||
*
|
*
|
||||||
* There is a tiny probability that SIGHUP and Ctrl-Alt-Del will collide
|
* There is a tiny probability that SIGHUP and Ctrl-Alt-Del will collide
|
||||||
* and only one will be remebered and acted upon.
|
* and only one will be remembered and acted upon.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void halt_reboot_pwoff(int sig) NORETURN;
|
static void halt_reboot_pwoff(int sig) NORETURN;
|
||||||
@ -782,23 +782,23 @@ static void reload_inittab(void)
|
|||||||
*/
|
*/
|
||||||
parse_inittab();
|
parse_inittab();
|
||||||
|
|
||||||
if (ENABLE_FEATURE_KILL_REMOVED) {
|
#if ENABLE_FEATURE_KILL_REMOVED
|
||||||
/* Kill stale entries */
|
/* Kill stale entries */
|
||||||
/* Be nice and send SIGTERM first */
|
/* Be nice and send SIGTERM first */
|
||||||
for (a = init_action_list; a; a = a->next)
|
for (a = init_action_list; a; a = a->next)
|
||||||
if (a->action_type == ONCE && a->pid != 0)
|
if (a->action_type == ONCE && a->pid != 0)
|
||||||
kill(a->pid, SIGTERM);
|
kill(a->pid, SIGTERM);
|
||||||
if (CONFIG_FEATURE_KILL_DELAY) {
|
if (CONFIG_FEATURE_KILL_DELAY) {
|
||||||
/* NB: parent will wait in NOMMU case */
|
/* NB: parent will wait in NOMMU case */
|
||||||
if ((BB_MMU ? fork() : vfork()) == 0) { /* child */
|
if ((BB_MMU ? fork() : vfork()) == 0) { /* child */
|
||||||
sleep(CONFIG_FEATURE_KILL_DELAY);
|
sleep(CONFIG_FEATURE_KILL_DELAY);
|
||||||
for (a = init_action_list; a; a = a->next)
|
for (a = init_action_list; a; a = a->next)
|
||||||
if (a->action_type == ONCE && a->pid != 0)
|
if (a->action_type == ONCE && a->pid != 0)
|
||||||
kill(a->pid, SIGKILL);
|
kill(a->pid, SIGKILL);
|
||||||
_exit(EXIT_SUCCESS);
|
_exit(EXIT_SUCCESS);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Remove stale (ONCE) and not useful (SYSINIT,WAIT) entries */
|
/* Remove stale (ONCE) and not useful (SYSINIT,WAIT) entries */
|
||||||
nextp = &init_action_list;
|
nextp = &init_action_list;
|
||||||
|
@ -370,7 +370,7 @@ int runsvdir_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
opt_s_argv[1] = utoa(bb_got_signal);
|
opt_s_argv[1] = utoa(bb_got_signal);
|
||||||
pid = spawn(opt_s_argv);
|
pid = spawn(opt_s_argv);
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
/* Remebering to wait for _any_ children,
|
/* Remembering to wait for _any_ children,
|
||||||
* not just pid */
|
* not just pid */
|
||||||
while (wait(NULL) != pid)
|
while (wait(NULL) != pid)
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user