From 738a790778608a8590d93c790f11b484f1dd8da4 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Sat, 16 May 2015 01:12:21 +0200 Subject: 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. --- src/udev/udevd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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)) { -- cgit v1.2.3-54-g00ecf