]> err.no Git - systemd/commitdiff
libudev: monitor - add udev_monitor_filter_remove
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 23 Apr 2009 02:07:51 +0000 (04:07 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Thu, 23 Apr 2009 02:07:51 +0000 (04:07 +0200)
udev/lib/exported_symbols
udev/lib/libudev-monitor.c
udev/lib/libudev.h

index a700f98ac874f2ef582a8972042a5a68ff8dd84a..5b0d8fd011ed7be72e0920defec8f0eb96eafd94 100644 (file)
@@ -57,6 +57,7 @@ udev_monitor_get_udev
 udev_monitor_get_fd
 udev_monitor_receive_device
 udev_monitor_filter_add_match_subsystem_devtype
+udev_monitor_filter_remove
 udev_queue_new
 udev_queue_ref
 udev_queue_unref
index 211aa12f62b1b770aa09edff05acfdda525ff202..bf95657da2979e78e5eac5b683563c186e11b1c2 100644 (file)
@@ -707,3 +707,11 @@ int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_mo
                return -ENOMEM;
        return 0;
 }
+
+int udev_monitor_filter_remove(struct udev_monitor *udev_monitor)
+{
+       static struct sock_fprog filter = { 0, NULL };
+
+       udev_list_cleanup_entries(udev_monitor->udev, &udev_monitor->filter_subsystem_list);
+       return setsockopt(udev_monitor->sock, SOL_SOCKET, SO_ATTACH_FILTER, &filter, sizeof(filter));
+}
index e366d7687713c655e871bd42453cc9b906bb82a5..0b52e6e775ff088082f1b076a5084bdc215b6b58 100644 (file)
@@ -85,6 +85,7 @@ extern struct udev *udev_monitor_get_udev(struct udev_monitor *udev_monitor);
 extern int udev_monitor_get_fd(struct udev_monitor *udev_monitor);
 extern struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monitor);
 extern int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor, const char *subsystem, const char *devtype);
+extern int udev_monitor_filter_remove(struct udev_monitor *udev_monitor);
 
 /* sys enumeration */
 struct udev_enumerate;