chiark / gitweb /
Prep v239: Utilize new user_runtime_dir() function
[elogind.git] / src / login / logind.c
index 048689fadc81a6e0dea5307c4e71b7dd6905088d..db26701dd3944ce431405c4153d3c2dffd7f4e5a 100644 (file)
@@ -22,7 +22,7 @@
 #include "format-util.h"
 #include "fs-util.h"
 #include "logind.h"
-//#include "parse-util.h"
+#include "parse-util.h"
 //#include "process-util.h"
 #include "selinux-util.h"
 #include "signal-util.h"
@@ -39,8 +39,6 @@
 static Manager* manager_unref(Manager *m);
 DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_unref);
 
-#if 0 /// elogind does not support autospawning of vts
-#endif // 0
 static int manager_new(Manager **ret) {
         _cleanup_(manager_unrefp) Manager *m = NULL;
         int r;
@@ -74,7 +72,7 @@ static int manager_new(Manager **ret) {
 #if 1 /// elogind needs some more data
         r = elogind_manager_new(m);
         if (r < 0)
-                goto fail;
+                return r;
 #endif // 1
         m->udev = udev_new();
         if (!m->udev)
@@ -1107,18 +1105,6 @@ static int manager_dispatch_idle_action(sd_event_source *s, uint64_t t, void *us
         return 0;
 }
 
-#if 0 /// elogind parses its own config file
-#else
-         const char* logind_conf = getenv("ELOGIND_CONF_FILE");
-
-         assert(m);
-
-         if (!logind_conf)
-                 logind_conf = PKGSYSCONFDIR "/logind.conf";
-
-         return config_parse(NULL, logind_conf, NULL, "Login\0Sleep\0",
-                             config_item_perf_lookup, logind_gperf_lookup,
-#endif // 0
 static int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) {
         Manager *m = userdata;
         int r;
@@ -1303,12 +1289,6 @@ int main(int argc, char *argv[]) {
         (void) mkdir_label("/run/systemd/seats", 0755);
         (void) mkdir_label("/run/systemd/users", 0755);
         (void) mkdir_label("/run/systemd/sessions", 0755);
-
-        assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGHUP, SIGTERM, SIGINT, -1) >= 0);
-
-        r = manager_new(&m);
-        if (r < 0) {
-                log_error_errno(r, "Failed to allocate manager object: %m");
 #else
         r = mkdir_label("/run/systemd", 0755);
         if ( (r < 0) && (-EEXIST != r) )
@@ -1326,6 +1306,12 @@ int main(int argc, char *argv[]) {
         if ( r < 0 && (-EEXIST != r) )
                 return log_error_errno(r, "Failed to create /run/systemd/machines : %m");
 #endif // 0
+
+        assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGHUP, SIGTERM, SIGINT, -1) >= 0);
+
+        r = manager_new(&m);
+        if (r < 0) {
+                log_error_errno(r, "Failed to allocate manager object: %m");
                 goto finish;
         }