Ignore interupts when waiting for processes to finish. Also, style fixes.
This commit is contained in:
parent
b859710cc8
commit
8b76e1d2e0
18
src/rc/rc.c
18
src/rc/rc.c
@ -129,28 +129,28 @@ clean_failed(void)
|
||||
static void
|
||||
cleanup(void)
|
||||
{
|
||||
if (applet && strcmp(applet, "rc") == 0) {
|
||||
#ifdef DEBUG_MEMORY
|
||||
RC_PID *p1 = LIST_FIRST(&service_pids);
|
||||
RC_PID *p2;
|
||||
#endif
|
||||
|
||||
if (!rc_in_logger && !rc_in_plugin &&
|
||||
applet && strcmp(applet, "rc") == 0)
|
||||
{
|
||||
if (hook_out)
|
||||
rc_plugin_run(hook_out, runlevel);
|
||||
|
||||
rc_plugin_unload();
|
||||
|
||||
if (! rc_in_plugin && termios_orig) {
|
||||
if (termios_orig) {
|
||||
tcsetattr(STDIN_FILENO, TCSANOW, termios_orig);
|
||||
free(termios_orig);
|
||||
}
|
||||
|
||||
/* Clean runlevel start, stop markers */
|
||||
if (! rc_in_plugin && ! rc_in_logger) {
|
||||
rmdir(RC_STARTING);
|
||||
rmdir(RC_STOPPING);
|
||||
clean_failed();
|
||||
|
||||
rc_logger_close();
|
||||
}
|
||||
|
||||
@ -170,7 +170,6 @@ cleanup(void)
|
||||
free(runlevel);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
static char *
|
||||
@ -420,7 +419,12 @@ remove_pid(pid_t pid)
|
||||
static void
|
||||
wait_for_services(void)
|
||||
{
|
||||
while (waitpid(0, 0, 0) != -1);
|
||||
for (;;) {
|
||||
while (waitpid(0, 0, 0) != -1)
|
||||
;
|
||||
if (errno != EINTR)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@ -602,7 +606,7 @@ do_stop_services(const char *newlevel, bool parallel)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* We got this far! Or last check is to see if any any service
|
||||
/* We got this far. Last check is to see if any any service
|
||||
* that going to be started depends on us */
|
||||
if (!svc1) {
|
||||
tmplist = rc_stringlist_new();
|
||||
|
Loading…
Reference in New Issue
Block a user