X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=src%2Flogin%2Flogind.c;h=2e4342b0aedf4af9792bae02018107ac46fca38e;hb=d2338db3145922b1dfcb3b458e5bce2568a9347a;hp=23f4059931d456f192112f3e3e9a8ef6a457bf61;hpb=34c7fcb14d705141c71b5b63a2f044a51ffbd92b;p=elogind.git diff --git a/src/login/logind.c b/src/login/logind.c index 23f405993..2e4342b0a 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -30,11 +30,11 @@ #include "conf-parser.h" #include "bus-util.h" #include "bus-error.h" -#include "logind.h" #include "udev-util.h" #include "formats-util.h" +#include "signal-util.h" #include "label.h" -#include "label.h" +#include "logind.h" #include "cgroup.h" #include "mount-setup.h" #include "virt.h" @@ -97,7 +97,7 @@ static Manager *manager_new(void) { goto fail; /* If elogind should be its own controller, mount its cgroup */ - if (streq(ELOGIND_CGROUP_CONTROLLER, "name=elogind")) { + if (streq(SYSTEMD_CGROUP_CONTROLLER, "name=elogind")) { r = mount_setup(true); if (r < 0) goto fail; @@ -203,7 +203,7 @@ static void manager_free(Manager *m) { udev_unref(m->udev); if (m->unlink_nologin) - unlink("/run/nologin"); + (void) unlink("/run/nologin"); bus_verify_polkit_async_registry_free(m->polkit_registry); @@ -218,8 +218,8 @@ static void manager_free(Manager *m) { /* Avoid the creation of new processes forked by the * kernel; at this point, we will not listen to the * signals anyway */ - if (detect_container(NULL) <= 0) - (void) cg_uninstall_release_agent(ELOGIND_CGROUP_CONTROLLER); + if (detect_container() <= 0) + (void) cg_uninstall_release_agent(SYSTEMD_CGROUP_CONTROLLER); manager_shutdown_cgroup(m, true); @@ -869,13 +869,8 @@ static int manager_connect_console(Manager *m) { return -EINVAL; } - r = ignore_signals(SIGRTMIN + 1, -1); - if (r < 0) - return log_error_errno(r, "Cannot ignore SIGRTMIN + 1: %m"); - - r = sigprocmask_many(SIG_BLOCK, SIGRTMIN, -1); - if (r < 0) - return log_error_errno(r, "Cannot block SIGRTMIN: %m"); + assert_se(ignore_signals(SIGRTMIN + 1, -1) >= 0); + assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGRTMIN, -1) >= 0); r = sd_event_add_signal(m->event, NULL, SIGRTMIN, manager_vt_switch, m); if (r < 0) @@ -1202,6 +1197,12 @@ static int manager_run(Manager *m) { manager_gc(m, true); + r = manager_dispatch_delayed(m, false); + if (r < 0) + return r; + if (r > 0) + continue; + r = sd_event_run(m->event, (uint64_t) -1); if (r < 0) return r;