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>
This commit is contained in:
Tom Gundersen 2015-05-27 08:21:49 -04:00 committed by Anthony G. Basile
parent 8ab818626d
commit a5be4ae907

View File

@ -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;