libudev: shorten code a bit

fd_wait_for_event() or ppoll() does not return -EAGAIN.
This commit is contained in:
Yu Watanabe 2021-03-02 17:17:16 +09:00
parent dbdcd51f78
commit 1d61d70abb

View file

@ -206,12 +206,10 @@ static int udev_monitor_receive_sd_device(struct udev_monitor *udev_monitor, sd_
for (;;) {
/* Wait for next message */
r = fd_wait_for_event(device_monitor_get_fd(udev_monitor->monitor), POLLIN, 0);
if (r < 0) {
if (IN_SET(r, -EINTR, -EAGAIN))
continue;
if (r == -EINTR)
continue;
if (r < 0)
return r;
}
if (r == 0)
return -EAGAIN;