mirror of
https://github.com/troglobit/finit.git
synced 2026-11-10 16:31:21 +00:00
initctl: exit immediately on signal (from Finit)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
74ad34a0c5
commit
b994858907
1 file changed
+5
-3
+5
-3
@@ -86,11 +86,13 @@ int client_send(struct init_request *rq, ssize_t len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pfd.fd = sd;
|
pfd.fd = sd;
|
||||||
pfd.events = POLLIN;
|
pfd.events = POLLIN | POLLERR | POLLHUP;
|
||||||
if ((rc = poll(&pfd, 1, 2000)) <= 0) {
|
if ((rc = poll(&pfd, 1, 2000)) <= 0) {
|
||||||
if (rc)
|
if (rc) {
|
||||||
|
if (errno == EINTR) /* shutdown/reboot */
|
||||||
|
goto exit;
|
||||||
warn("poll(), errno %d", errno);
|
warn("poll(), errno %d", errno);
|
||||||
else
|
} else
|
||||||
warnx("Timed out waiting for reply from Finit.");
|
warnx("Timed out waiting for reply from Finit.");
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user