summaryrefslogtreecommitdiffstats
path: root/src/libudev
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-03-02 09:17:16 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-03-03 21:03:44 +0100
commit1d61d70abb7bfef15d8aca140468c95388a42b6b (patch)
tree888ecd60ffa062f94fb4f4ac20bc7febbe4ef591 /src/libudev
parentrules: Move ID_SMARTCARD_READER definition to a <70 configuration. (diff)
downloadsystemd-1d61d70abb7bfef15d8aca140468c95388a42b6b.tar.xz
systemd-1d61d70abb7bfef15d8aca140468c95388a42b6b.zip
libudev: shorten code a bit
fd_wait_for_event() or ppoll() does not return -EAGAIN.
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/libudev-monitor.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index a93adbd7a2..4ddcf95d05 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;