summaryrefslogtreecommitdiff
path: root/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-29 06:45:59 +0100
committerLennart Poettering <lennart@poettering.net>2010-01-29 06:45:59 +0100
commitf94ea366d38fed424200b748cb042ca44f8c8d50 (patch)
tree6fdd0032d6a667c967e6c82530e5dd83bdd2e18d /manager.c
parentef734fd6c2ec4e5602bbfe2a0d26dcf39c14d2bf (diff)
monitor udev for device changes
Diffstat (limited to 'manager.c')
-rw-r--r--manager.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/manager.c b/manager.c
index ac1c79c5f6..e0ffe93270 100644
--- a/manager.c
+++ b/manager.c
@@ -56,7 +56,7 @@ Manager* manager_new(void) {
if (!(m = new0(Manager, 1)))
return NULL;
- m->signal_watch.fd = m->mount_watch.fd = m->epoll_fd = -1;
+ m->signal_watch.fd = m->mount_watch.fd = m->udev_watch.fd = m->epoll_fd = -1;
if (!(m->units = hashmap_new(string_hash_func, string_compare_func)))
goto fail;
@@ -1126,7 +1126,7 @@ static int process_event(Manager *m, struct epoll_event *ev, bool *quit) {
case WATCH_SIGNAL:
/* An incoming signal? */
- if (ev->events != POLLIN)
+ if (ev->events != EPOLLIN)
return -EINVAL;
if ((r = manager_process_signal_fd(m, quit)) < 0)
@@ -1162,6 +1162,11 @@ static int process_event(Manager *m, struct epoll_event *ev, bool *quit) {
mount_fd_event(m, ev->events);
break;
+ case WATCH_UDEV:
+ /* Some notification from udev, intended for the device subsystem */
+ device_fd_event(m, ev->events);
+ break;
+
default:
assert_not_reached("Unknown epoll event type.");
}