Check and clear events from poll() even if interrupted by signal.
This commit is contained in:
parent
1e60b4b8e7
commit
a91b1d34ac
@ -349,8 +349,7 @@ static void do_ifch_work(void)
|
||||
|
||||
for (;;) {
|
||||
if (poll(pfds, 2, -1) < 0) {
|
||||
if (errno == EINTR) continue;
|
||||
else suicide("pollt failed");
|
||||
if (errno != EINTR) suicide("poll failed");
|
||||
}
|
||||
if (pfds[0].revents & POLLIN) {
|
||||
pfds[0].revents &= ~POLLIN;
|
||||
|
@ -298,8 +298,7 @@ static void do_ndhc_work(void)
|
||||
pfds[5].fd = cs.listenFd;
|
||||
had_event = false;
|
||||
if (poll(pfds, 6, timeout) < 0) {
|
||||
if (errno != EINTR)
|
||||
suicide("poll failed");
|
||||
if (errno != EINTR) suicide("poll failed");
|
||||
}
|
||||
|
||||
bool sev_dhcp = false;
|
||||
@ -524,8 +523,7 @@ static void wait_for_rfkill()
|
||||
for (;;) {
|
||||
pfds[0].fd = cs.rfkillFd;
|
||||
if (poll(pfds, 1, -1) < 0) {
|
||||
if (errno == EINTR) continue;
|
||||
else suicide("poll failed");
|
||||
if (errno != EINTR) suicide("poll failed");
|
||||
}
|
||||
if (pfds[0].revents & POLLIN) {
|
||||
pfds[0].revents &= ~POLLIN;
|
||||
|
@ -554,8 +554,7 @@ static void do_sockd_work(void)
|
||||
|
||||
for (;;) {
|
||||
if (poll(pfds, 2, -1) < 0) {
|
||||
if (errno == EINTR) continue;
|
||||
else suicide("poll failed");
|
||||
if (errno != EINTR) suicide("poll failed");
|
||||
}
|
||||
if (pfds[0].revents & POLLIN) {
|
||||
pfds[0].revents &= ~POLLIN;
|
||||
|
Loading…
Reference in New Issue
Block a user