summaryrefslogtreecommitdiff
path: root/udev/udevadm-monitor.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-08-04 22:59:58 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-08-04 22:59:58 +0200
commit869c9031608f0796bb4363d5de5db058fe96fedd (patch)
treec4569f8c48ae4e6e5f046642264e71ad811312d7 /udev/udevadm-monitor.c
parentce0119d98af6d8306f0877bd30adda945d1a3621 (diff)
libudev: list - use binary search for list lookup
Diffstat (limited to 'udev/udevadm-monitor.c')
-rw-r--r--udev/udevadm-monitor.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/udev/udevadm-monitor.c b/udev/udevadm-monitor.c
index 7ea7aa0f70..64913dbd55 100644
--- a/udev/udevadm-monitor.c
+++ b/udev/udevadm-monitor.c
@@ -72,8 +72,8 @@ static int adm_monitor(struct udev *udev, int argc, char *argv[])
bool prop = false;
bool print_kernel = false;
bool print_udev = false;
- struct udev_list_node subsystem_match_list;
- struct udev_list_node tag_match_list;
+ struct udev_list subsystem_match_list;
+ struct udev_list tag_match_list;
struct udev_monitor *udev_monitor = NULL;
struct udev_monitor *kernel_monitor = NULL;
int fd_ep = -1;
@@ -92,8 +92,8 @@ static int adm_monitor(struct udev *udev, int argc, char *argv[])
{}
};
- udev_list_init(&subsystem_match_list);
- udev_list_init(&tag_match_list);
+ udev_list_init(udev, &subsystem_match_list, true);
+ udev_list_init(udev, &tag_match_list, true);
for (;;) {
option = getopt_long(argc, argv, "pekus:t:h", options, NULL);
@@ -122,11 +122,11 @@ static int adm_monitor(struct udev *udev, int argc, char *argv[])
devtype[0] = '\0';
devtype++;
}
- udev_list_entry_add(udev, &subsystem_match_list, subsys, devtype, 0);
+ udev_list_entry_add(&subsystem_match_list, subsys, devtype);
break;
}
case 't':
- udev_list_entry_add(udev, &tag_match_list, optarg, NULL, 0);
+ udev_list_entry_add(&tag_match_list, optarg, NULL);
break;
case 'h':
printf("Usage: udevadm monitor [--property] [--kernel] [--udev] [--help]\n"
@@ -285,8 +285,8 @@ out:
close(fd_ep);
udev_monitor_unref(udev_monitor);
udev_monitor_unref(kernel_monitor);
- udev_list_cleanup_entries(udev, &subsystem_match_list);
- udev_list_cleanup_entries(udev, &tag_match_list);
+ udev_list_cleanup(&subsystem_match_list);
+ udev_list_cleanup(&tag_match_list);
return rc;
}