chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add first_word() call
[elogind.git]
/
manager.c
diff --git
a/manager.c
b/manager.c
index ac1c79c5f6f634a2c6e98235801a3e194c39ecdf..e0ffe93270a4e10479dc54fb0be3851ac5a12df0 100644
(file)
--- a/
manager.c
+++ b/
manager.c
@@
-56,7
+56,7
@@
Manager* manager_new(void) {
if (!(m = new0(Manager, 1)))
return NULL;
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;
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? */
case WATCH_SIGNAL:
/* An incoming signal? */
- if (ev->events != POLLIN)
+ if (ev->events !=
E
POLLIN)
return -EINVAL;
if ((r = manager_process_signal_fd(m, quit)) < 0)
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;
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.");
}
default:
assert_not_reached("Unknown epoll event type.");
}