if (timeout > 0) {
s = poll(fds, 2, timeout);
if (s == -1) {
- if (errno == EINTR) {
- if (signal_exists(NULL) == -1) {
- errno = 0;
- continue;
- } else
- break;
- }
-
- logger(LOG_ERR, "poll: `%s'", strerror(errno));
+ if (errno != EINTR)
+ logger(LOG_ERR, "poll: `%s'", strerror(errno));
break;
}
}
continue;
}
+ /* Check if signalled */
+ if ((fds[0].revents & POLLIN)) {
+ errno = EINTR;
+ return -1;
+ }
+
if (!(fds[1].revents & POLLIN))
continue;
for(;;) {
inet_ntoa(reply_ipv4),
hwaddr_ntoa((unsigned char *)&reply_mac,
(size_t)reply.ar_hln));
+ errno = EEXIST;
retval = -1;
goto eexit;
}