initctl: exit immediately on signal (from Finit)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-02-13 22:45:47 +01:00
parent 74ad34a0c5
commit b994858907
+5 -3
View File
@@ -86,11 +86,13 @@ int client_send(struct init_request *rq, ssize_t len)
}
pfd.fd = sd;
pfd.events = POLLIN;
pfd.events = POLLIN | POLLERR | POLLHUP;
if ((rc = poll(&pfd, 1, 2000)) <= 0) {
if (rc)
if (rc) {
if (errno == EINTR) /* shutdown/reboot */
goto exit;
warn("poll(), errno %d", errno);
else
} else
warnx("Timed out waiting for reply from Finit.");
goto exit;
}