chiark / gitweb /
libudev: monitor - switch to filter_add_match_subsystem_devtype()
[elogind.git] / udev / lib / test-libudev.c
index be167cff47436ae7ddf27891e930d532af285383..db08d4845f31572bc078624c10201465855ca907 100644 (file)
@@ -228,6 +228,12 @@ static int test_monitor(struct udev *udev)
                printf("no socket\n");
                return -1;
        }
+       if (udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "block", NULL) < 0 ||
+           udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "tty", NULL) < 0 ||
+           udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "usb", "usb_device") < 0) {
+               printf("filter failed\n");
+               return -1;
+       }
        if (udev_monitor_enable_receiving(udev_monitor) < 0) {
                printf("bind failed\n");
                return -1;