Changeset View
Changeset View
Standalone View
Standalone View
sbin/init/init.c
Show First 20 Lines • Show All 1,137 Lines • ▼ Show 20 Lines | run_script(const char *script) | ||||
/* | /* | ||||
* Copied from single_user(). This is a bit paranoid. | * Copied from single_user(). This is a bit paranoid. | ||||
*/ | */ | ||||
requested_transition = 0; | requested_transition = 0; | ||||
do { | do { | ||||
if ((wpid = waitpid(-1, &status, WUNTRACED)) != -1) | if ((wpid = waitpid(-1, &status, WUNTRACED)) != -1) | ||||
collect_child(wpid); | collect_child(wpid); | ||||
if (wpid == -1) { | |||||
if (requested_transition == death_single || | if (requested_transition == death_single || | ||||
requested_transition == reroot) | requested_transition == reroot) | ||||
return (state_func_t) requested_transition; | return (state_func_t) requested_transition; | ||||
if (wpid == -1) { | |||||
if (errno == EINTR) | if (errno == EINTR) | ||||
continue; | continue; | ||||
warning("wait for %s on %s failed: %m; going to " | warning("wait for %s on %s failed: %m; going to " | ||||
"single user mode", shell, script); | "single user mode", shell, script); | ||||
return (state_func_t) single_user; | return (state_func_t) single_user; | ||||
} | } | ||||
if (wpid == pid && WIFSTOPPED(status)) { | if (wpid == pid && WIFSTOPPED(status)) { | ||||
warning("init: %s on %s stopped, restarting\n", | warning("init: %s on %s stopped, restarting\n", | ||||
▲ Show 20 Lines • Show All 1,005 Lines • Show Last 20 Lines |