]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
libudev: shorten code a bit
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 2 Mar 2021 08:17:16 +0000 (17:17 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 3 Mar 2021 20:03:44 +0000 (05:03 +0900)
fd_wait_for_event() or ppoll() does not return -EAGAIN.

src/libudev/libudev-monitor.c

index a93adbd7a2e977cf49484c8981363ff70ba2cac5..4ddcf95d05f57300c7b62b75e2c245a304de3515 100644 (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;