summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-05-27 08:21:49 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-05-27 08:21:49 -0400
commita5be4ae907d6da34d6ec83d4888bd9c75b8d349a (patch)
tree2e185bb9f8b729120eb3e3ce9798cf32050abe9e /src/udev
parent8ab818626d8ef8cd303e0c16765252c6fb22ef17 (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. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev')
-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 f9fa3f6e66..8966fa777e 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -641,8 +641,11 @@ static void worker_returned(int fd_worker) {
size = recvmsg(fd_worker, &msghdr, MSG_DONTWAIT);
if (size < 0) {
- if (errno == EAGAIN || errno == EINTR)
- return;
+ if (errno == EINTR)
+ continue;
+ else if (errno == EAGAIN)
+ /* nothing more to read */
+ break;
log_error_errno(errno, "failed to receive message: %m");
return;