mirror of
https://github.com/troglobit/finit.git
synced 2026-10-02 05:52:48 +07:00
api_exit(): Only shutdown() of API socket at runtime
Not needed at shutdown/reboot. Also, it may segfault at that stage. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -342,6 +342,7 @@ static void api_cb(uev_t *w, void *arg, int events)
|
||||
kill(wdogpid, SIGTERM);
|
||||
do_sleep(1);
|
||||
}
|
||||
_d("wdog was %d, now %d is in charge", wdogpid, rq.runlevel);
|
||||
wdogpid = rq.runlevel;
|
||||
break;
|
||||
|
||||
@@ -428,6 +429,9 @@ error:
|
||||
|
||||
int api_exit(void)
|
||||
{
|
||||
if (runlevel == 0 || runlevel == 6)
|
||||
return close(api_watcher.fd);
|
||||
|
||||
return shutdown(api_watcher.fd, SHUT_RDWR) ||
|
||||
close(api_watcher.fd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user