From 1d61d70abb7bfef15d8aca140468c95388a42b6b Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 2 Mar 2021 17:17:16 +0900 Subject: [PATCH] libudev: shorten code a bit fd_wait_for_event() or ppoll() does not return -EAGAIN. --- src/libudev/libudev-monitor.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c index a93adbd7a2e..4ddcf95d05f 100644 --- a/src/libudev/libudev-monitor.c +++ b/src/libudev/libudev-monitor.c @@ -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; -- 2.47.3