From: Tom Gundersen Date: Fri, 15 May 2015 23:12:21 +0000 (+0200) Subject: udevd: on_worker - distinguish between EINTR and EAGAIN X-Git-Tag: v220~107 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=738a790778608a8590d93c790f11b484f1dd8da4;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 8142ec605dc..a7f14c058be 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)) {