chiark / gitweb /
greatly extend what we enforce as process properties
[elogind.git] / manager.c
index ac1c79c5f6f634a2c6e98235801a3e194c39ecdf..fca1963af1a111782d982b20c8e50a24ce31ef5b 100644 (file)
--- 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;
@@ -1060,7 +1060,7 @@ static int manager_dispatch_sigchld(Manager *m) {
                 if (si.si_code != CLD_EXITED && si.si_code != CLD_KILLED && si.si_code != CLD_DUMPED)
                         continue;
 
-                log_debug("child %llu died (code=%s, status=%i)", (long long unsigned) si.si_pid, sigchld_code(si.si_code), si.si_status);
+                log_debug("child %llu died (code=%s, status=%i)", (long long unsigned) si.si_pid, sigchld_code_to_string(si.si_code), si.si_status);
 
                 if (!(u = hashmap_remove(m->watch_pids, UINT32_TO_PTR(si.si_pid))))
                         continue;
@@ -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.");
         }