summaryrefslogtreecommitdiff
path: root/src/udev/udevd.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-05-16 01:12:21 +0200
committerTom Gundersen <teg@jklm.no>2015-05-16 01:14:48 +0200
commit738a790778608a8590d93c790f11b484f1dd8da4 (patch)
treee4f43e99c2ec601168785a4ea3a5cb0c3332be78 /src/udev/udevd.c
parent9a73bd7cab019aa1b9b4342ce2abd51b6e50b085 (diff)
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.
Diffstat (limited to 'src/udev/udevd.c')
-rw-r--r--src/udev/udevd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 8142ec605d..a7f14c058b 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -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)) {