X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flogin%2Flogind.c;h=28d7058fe28b3793a922e8fefec70117f690bcbf;hb=90e633a7901060063e62bf53948c4c239a9f55d1;hp=2add2410664102c1391991c71880a781266431b4;hpb=b58b227a53ee2b9feba8433a1558b51132ffb18b;p=elogind.git diff --git a/src/login/logind.c b/src/login/logind.c index 2add24106..28d7058fe 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -73,8 +73,7 @@ Manager *manager_new(void) { m->busnames = set_new(string_hash_func, string_compare_func); if (!m->devices || !m->seats || !m->sessions || !m->users || !m->inhibitors || !m->buttons || !m->busnames || - !m->user_units || !m->session_units || - !m->busnames) { + !m->user_units || !m->session_units) { manager_free(m); return NULL; } @@ -742,7 +741,7 @@ static int manager_connect_console(Manager *m) { return -errno; } - r = sd_event_add_io(m->event, m->console_active_fd, 0, manager_dispatch_console, m, &m->console_active_event_source); + r = sd_event_add_io(m->event, &m->console_active_event_source, m->console_active_fd, 0, manager_dispatch_console, m); if (r < 0) { log_error("Failed to watch foreground console"); return r; @@ -772,7 +771,7 @@ static int manager_connect_udev(Manager *m) { if (r < 0) return r; - r = sd_event_add_io(m->event, udev_monitor_get_fd(m->udev_seat_monitor), EPOLLIN, manager_dispatch_seat_udev, m, &m->udev_seat_event_source); + r = sd_event_add_io(m->event, &m->udev_seat_event_source, udev_monitor_get_fd(m->udev_seat_monitor), EPOLLIN, manager_dispatch_seat_udev, m); if (r < 0) return r; @@ -796,7 +795,7 @@ static int manager_connect_udev(Manager *m) { if (r < 0) return r; - r = sd_event_add_io(m->event, udev_monitor_get_fd(m->udev_device_monitor), EPOLLIN, manager_dispatch_device_udev, m, &m->udev_device_event_source); + r = sd_event_add_io(m->event, &m->udev_device_event_source, udev_monitor_get_fd(m->udev_device_monitor), EPOLLIN, manager_dispatch_device_udev, m); if (r < 0) return r; @@ -822,7 +821,7 @@ static int manager_connect_udev(Manager *m) { if (r < 0) return r; - r = sd_event_add_io(m->event, udev_monitor_get_fd(m->udev_button_monitor), EPOLLIN, manager_dispatch_button_udev, m, &m->udev_button_event_source); + r = sd_event_add_io(m->event, &m->udev_button_event_source, udev_monitor_get_fd(m->udev_button_monitor), EPOLLIN, manager_dispatch_button_udev, m); if (r < 0) return r; } @@ -842,7 +841,7 @@ static int manager_connect_udev(Manager *m) { if (r < 0) return r; - r = sd_event_add_io(m->event, udev_monitor_get_fd(m->udev_vcsa_monitor), EPOLLIN, manager_dispatch_vcsa_udev, m, &m->udev_vcsa_event_source); + r = sd_event_add_io(m->event, &m->udev_vcsa_event_source, udev_monitor_get_fd(m->udev_vcsa_monitor), EPOLLIN, manager_dispatch_vcsa_udev, m); if (r < 0) return r; } @@ -936,7 +935,7 @@ static int manager_dispatch_idle_action(sd_event_source *s, uint64_t t, void *us if (!m->idle_action_event_source) { - r = sd_event_add_monotonic(m->event, elapse, USEC_PER_SEC*30, manager_dispatch_idle_action, m, &m->idle_action_event_source); + r = sd_event_add_monotonic(m->event, &m->idle_action_event_source, elapse, USEC_PER_SEC*30, manager_dispatch_idle_action, m); if (r < 0) { log_error("Failed to add idle event source: %s", strerror(-r)); return r;