mirror of
https://github.com/systemd/systemd.git
synced 2024-10-31 16:21:26 +03:00
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.
This commit is contained in:
parent
9a73bd7cab
commit
738a790778
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user