From 13052c02851b1dfb81c584eee141b83f80c98e0e Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sun, 17 Apr 2011 22:10:18 +0200 Subject: [PATCH] use 'else if' in epoll event array loop --- libudev/test-libudev.c | 4 +--- udev/udevadm-monitor.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/libudev/test-libudev.c b/libudev/test-libudev.c index 9dc86bd9..4192ba14 100644 --- a/libudev/test-libudev.c +++ b/libudev/test-libudev.c @@ -286,9 +286,7 @@ static int test_monitor(struct udev *udev) } print_device(device); udev_device_unref(device); - } - - if (ev[i].data.fd == STDIN_FILENO && ev[i].events & EPOLLIN) { + } else if (ev[i].data.fd == STDIN_FILENO && ev[i].events & EPOLLIN) { printf("exiting loop\n"); goto out; } diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c index 8fe9e052..e1bb6fe1 100644 --- a/udev/udevadm-monitor.c +++ b/udev/udevadm-monitor.c @@ -266,9 +266,7 @@ int udevadm_monitor(struct udev *udev, int argc, char *argv[]) continue; print_device(device, "KERNEL", prop); udev_device_unref(device); - } - - if (ev[i].data.fd == fd_udev && ev[i].events & EPOLLIN) { + } else if (ev[i].data.fd == fd_udev && ev[i].events & EPOLLIN) { struct udev_device *device; device = udev_monitor_receive_device(udev_monitor); -- 2.39.5