chiark / gitweb /
Beginnings of handling suspend/etc within logind
[elogind.git] / src / login / logind.c
index 5856c336f6492c306ef6907e98a1535297082bbf..bcf23d225703f81a7a90518c48e016bc4775c93e 100644 (file)
@@ -30,8 +30,9 @@
 #include "conf-parser.h"
 #include "bus-util.h"
 #include "bus-error.h"
-#include "logind.h"
 #include "udev-util.h"
+#include "signal-util.h"
+#include "logind.h"
 
 Manager *manager_new(void) {
         Manager *m;
@@ -160,7 +161,6 @@ void manager_free(Manager *m) {
         strv_free(m->kill_only_users);
         strv_free(m->kill_exclude_users);
 
-        free(m->action_job);
         free(m);
 }
 
@@ -671,13 +671,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)
@@ -980,7 +975,7 @@ int manager_run(Manager *m) {
                 if (manager_dispatch_delayed(m) > 0)
                         continue;
 
-                if (m->action_what != 0 && !m->action_job) {
+                if (m->action_what != 0) {
                         usec_t x, y;
 
                         x = now(CLOCK_MONOTONIC);