From a5be4ae907d6da34d6ec83d4888bd9c75b8d349a Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Wed, 27 May 2015 08:21:49 -0400 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. Signed-off-by: Anthony G. Basile --- 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 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; -- cgit v1.2.3-54-g00ecf