1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-31 16:21:26 +03:00

udevd: on_worker - distinguish between EINTR and EAGAIN

EAGAIN means there are no more messages to read, so give up. EINTR means we got interrupted
reading a message, so try again.
This commit is contained in:
Tom Gundersen 2015-05-16 01:12:21 +02:00
parent 9a73bd7cab
commit 738a790778

View File

@ -667,8 +667,11 @@ static int on_worker(sd_event_source *s, int fd, uint32_t revents, void *userdat
size = recvmsg(fd, &msghdr, MSG_DONTWAIT);
if (size < 0) {
if (errno == EAGAIN || errno == EINTR)
return 1;
if (errno == EINTR)
continue;
else if (errno == EAGAIN)
/* nothing more to read */
break;
return log_error_errno(errno, "failed to receive message: %m");
} else if (size != sizeof(struct worker_message)) {