]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevd: on_worker - distinguish between EINTR and EAGAIN
authorTom Gundersen <teg@jklm.no>
Fri, 15 May 2015 23:12:21 +0000 (01:12 +0200)
committerTom Gundersen <teg@jklm.no>
Fri, 15 May 2015 23:14:48 +0000 (01:14 +0200)
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

index 8142ec605dc9b4e774cbe8cace7e9a1e67364e8a..a7f14c058bedaf89a65adcdafd6abe6fd44d3fa4 100644 (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)) {