diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-03-29 20:08:52 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2009-03-29 20:08:52 +0200 |
commit | f2b937440c682bca3837263a1bafd78e30b17e4d (patch) | |
tree | 75fee1f072e1886811dad5dc09d63e129532e2aa /udev/lib | |
parent | 116254097ad3c07d9f7ed06042dbec7ba4f0f4fd (diff) |
"UDEV_MONITOR_KERNEL/UDEV" -> "kernel/udev"
Diffstat (limited to 'udev/lib')
-rw-r--r-- | udev/lib/libudev-monitor.c | 18 | ||||
-rw-r--r-- | udev/lib/libudev.h | 6 |
2 files changed, 18 insertions, 6 deletions
diff --git a/udev/lib/libudev-monitor.c b/udev/lib/libudev-monitor.c index b2f76c3129..d006596e07 100644 --- a/udev/lib/libudev-monitor.c +++ b/udev/lib/libudev-monitor.c @@ -34,6 +34,11 @@ struct udev_monitor { socklen_t addrlen; }; +enum udev_monitor_netlink_group { + UDEV_MONITOR_KERNEL = 1, + UDEV_MONITOR_UDEV = 2, +}; + /** * udev_monitor_new_from_socket: * @udev: udev library context @@ -91,12 +96,23 @@ struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char return udev_monitor; } -struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, unsigned int group) +struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char *name) { struct udev_monitor *udev_monitor; + unsigned int group; if (udev == NULL) return NULL; + + if (name == NULL) + return NULL; + if (strcmp(name, "kernel") == 0) + group = UDEV_MONITOR_KERNEL; + else if (strcmp(name, "udev") == 0) + group = UDEV_MONITOR_UDEV; + else + return NULL; + udev_monitor = calloc(1, sizeof(struct udev_monitor)); if (udev_monitor == NULL) return NULL; diff --git a/udev/lib/libudev.h b/udev/lib/libudev.h index be09ddb75a..e0aa571e26 100644 --- a/udev/lib/libudev.h +++ b/udev/lib/libudev.h @@ -76,12 +76,8 @@ extern const char *udev_device_get_sysattr_value(struct udev_device *udev_device /* udev and kernel device events */ struct udev_monitor; -enum udev_monitor_netlink_group { - UDEV_MONITOR_KERNEL = 1, - UDEV_MONITOR_UDEV = 2, -}; extern struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char *socket_path); -extern struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, enum udev_monitor_netlink_group group); +extern struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char *name); extern int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor); extern struct udev_monitor *udev_monitor_ref(struct udev_monitor *udev_monitor); extern void udev_monitor_unref(struct udev_monitor *udev_monitor); |