+ return manager_dispatch_sigchld(m);
+
+ return 0;
+}
+
+static int process_event(Manager *m, struct epoll_event *ev, bool *quit) {
+ int r;
+ Watch *w;
+
+ assert(m);
+ assert(ev);
+
+ assert(w = ev->data.ptr);
+
+ switch (w->type) {
+
+ case WATCH_SIGNAL_FD:
+
+ /* An incoming signal? */
+ if (ev->events != POLLIN)
+ return -EINVAL;
+
+ if ((r = manager_process_signal_fd(m, quit)) < 0)
+ return r;
+
+ break;
+
+ case WATCH_FD:
+
+ /* Some fd event, to be dispatched to the units */
+ UNIT_VTABLE(w->unit)->fd_event(w->unit, w->fd, ev->events, w);
+ break;
+
+ case WATCH_TIMER: {
+ uint64_t v;
+ ssize_t k;
+
+ /* Some timer event, to be dispatched to the units */
+ if ((k = read(ev->data.fd, &v, sizeof(v))) != sizeof(v)) {
+
+ if (k < 0 && (errno == EINTR || errno == EAGAIN))
+ break;
+
+ return k < 0 ? -errno : -EIO;
+ }
+
+ UNIT_VTABLE(w->unit)->timer_event(w->unit, v, w);
+ break;
+ }
+
+ default:
+ assert_not_reached("Unknown epoll event type.");
+ }