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 (;;) {
|
for (;;) {
|
||||||
if (poll(pfds, 2, -1) < 0) {
|
if (poll(pfds, 2, -1) < 0) {
|
||||||
if (errno == EINTR) continue;
|
if (errno != EINTR) suicide("poll failed");
|
||||||
else suicide("pollt failed");
|
|
||||||
}
|
}
|
||||||
if (pfds[0].revents & POLLIN) {
|
if (pfds[0].revents & POLLIN) {
|
||||||
pfds[0].revents &= ~POLLIN;
|
pfds[0].revents &= ~POLLIN;
|
||||||
|
@ -298,8 +298,7 @@ static void do_ndhc_work(void)
|
|||||||
pfds[5].fd = cs.listenFd;
|
pfds[5].fd = cs.listenFd;
|
||||||
had_event = false;
|
had_event = false;
|
||||||
if (poll(pfds, 6, timeout) < 0) {
|
if (poll(pfds, 6, timeout) < 0) {
|
||||||
if (errno != EINTR)
|
if (errno != EINTR) suicide("poll failed");
|
||||||
suicide("poll failed");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sev_dhcp = false;
|
bool sev_dhcp = false;
|
||||||
@ -524,8 +523,7 @@ static void wait_for_rfkill()
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
pfds[0].fd = cs.rfkillFd;
|
pfds[0].fd = cs.rfkillFd;
|
||||||
if (poll(pfds, 1, -1) < 0) {
|
if (poll(pfds, 1, -1) < 0) {
|
||||||
if (errno == EINTR) continue;
|
if (errno != EINTR) suicide("poll failed");
|
||||||
else suicide("poll failed");
|
|
||||||
}
|
}
|
||||||
if (pfds[0].revents & POLLIN) {
|
if (pfds[0].revents & POLLIN) {
|
||||||
pfds[0].revents &= ~POLLIN;
|
pfds[0].revents &= ~POLLIN;
|
||||||
|
@ -554,8 +554,7 @@ static void do_sockd_work(void)
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (poll(pfds, 2, -1) < 0) {
|
if (poll(pfds, 2, -1) < 0) {
|
||||||
if (errno == EINTR) continue;
|
if (errno != EINTR) suicide("poll failed");
|
||||||
else suicide("poll failed");
|
|
||||||
}
|
}
|
||||||
if (pfds[0].revents & POLLIN) {
|
if (pfds[0].revents & POLLIN) {
|
||||||
pfds[0].revents &= ~POLLIN;
|
pfds[0].revents &= ~POLLIN;
|
||||||
|
Loading…
Reference in New Issue
Block a user