chiark / gitweb /
use 'else if' in epoll event array loop
authorKay Sievers <kay.sievers@vrfy.org>
Sun, 17 Apr 2011 20:10:18 +0000 (22:10 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Sun, 17 Apr 2011 20:10:18 +0000 (22:10 +0200)
libudev/test-libudev.c
udev/udevadm-monitor.c

index 9dc86bd918aed2cdaba6216ecdb18f5e6d59fc49..4192ba14b24db7f65b98b3f0d7357704811a884a 100644 (file)
@@ -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;
                        }
index 8fe9e0527caec281419faead86fd2c475ad224ab..e1bb6fe18e7e00bc57bdabe6c0b45bd996ffd61f 100644 (file)
@@ -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);