chiark / gitweb /
Prep v225: Applying various fixes and changes to src/login that got lost during git...
[elogind.git] / src / login / logind.c
index 575bcee5b03579eb9a431c9458a3a8e7c8767f12..6cc6218b3de851df3aa715ed6166502a30bbe9f5 100644 (file)
@@ -34,7 +34,6 @@
 #include "udev-util.h"
 #include "formats-util.h"
 #include "label.h"
-#include "label.h"
 
 static void manager_free(Manager *m);
 
@@ -77,10 +76,7 @@ static Manager *manager_new(void) {
         m->user_units = hashmap_new(&string_hash_ops);
         m->session_units = hashmap_new(&string_hash_ops);
 
-        m->busnames = set_new(&string_hash_ops);
-
-        if (!m->devices || !m->seats || !m->sessions || !m->users || !m->inhibitors || !m->buttons || !m->busnames ||
-            !m->user_units || !m->session_units)
+        if (!m->devices || !m->seats || !m->sessions || !m->users || !m->inhibitors || !m->buttons || !m->user_units || !m->session_units)
                 goto fail;
 
         m->kill_exclude_users = strv_new("root", NULL);
@@ -142,8 +138,6 @@ static void manager_free(Manager *m) {
         hashmap_free(m->user_units);
         hashmap_free(m->session_units);
 
-        set_free_free(m->busnames);
-
         sd_event_source_unref(m->idle_action_event_source);
         sd_event_source_unref(m->inhibit_timeout_source);
         sd_event_source_unref(m->scheduled_shutdown_timeout_source);
@@ -159,16 +153,11 @@ static void manager_free(Manager *m) {
 
         safe_close(m->console_active_fd);
 
-        if (m->udev_seat_monitor)
                 udev_monitor_unref(m->udev_seat_monitor);
-        if (m->udev_device_monitor)
                 udev_monitor_unref(m->udev_device_monitor);
-        if (m->udev_vcsa_monitor)
                 udev_monitor_unref(m->udev_vcsa_monitor);
-        if (m->udev_button_monitor)
                 udev_monitor_unref(m->udev_button_monitor);
 
-        if (m->udev)
                 udev_unref(m->udev);
 
         if (m->unlink_nologin)
@@ -628,17 +617,6 @@ static int manager_connect_bus(Manager *m) {
                 return log_error_errno(r, "Failed to add user enumerator: %m");
 
         r = sd_bus_add_match(m->bus,
-                             NULL,
-                             "type='signal',"
-                             "sender='org.freedesktop.DBus',"
-                             "interface='org.freedesktop.DBus',"
-                             "member='NameOwnerChanged',"
-                             "path='/org/freedesktop/DBus'",
-                             match_name_owner_changed, m);
-        if (r < 0)
-                return log_error_errno(r, "Failed to add match for NameOwnerChanged: %m");
-
-       r = sd_bus_add_match(m->bus,
                              NULL,
                              "type='signal',"
                              "sender='org.freedesktop.systemd1',"
@@ -929,8 +907,8 @@ static void manager_gc(Manager *m, bool drop_not_started) {
                     session_get_state(session) != SESSION_CLOSING)
                         session_stop(session, false);
 
-                /* Normally, this should make the session busy again,
-                 * if it doesn't then let's get rid of it
+                /* Normally, this should make the session referenced
+                 * again, if it doesn't then let's get rid of it
                  * immediately */
                 if (!session_check_gc(session, drop_not_started)) {
                         session_finalize(session);
@@ -1124,8 +1102,8 @@ static int manager_run(Manager *m) {
 static int manager_parse_config_file(Manager *m) {
         assert(m);
 
-        return config_parse_many("/etc/elogind/elogind.conf",
-                                 CONF_DIRS_NULSTR("elogind/elogind.conf"),
+        return config_parse_many("/etc/systemd/logind.conf",
+                                 CONF_DIRS_NULSTR("systemd/logind.conf"),
                                  "Login\0",
                                  config_item_perf_lookup, logind_gperf_lookup,
                                  false, m);
@@ -1186,7 +1164,6 @@ finish:
                   "STOPPING=1\n"
                   "STATUS=Shutting down...");
 
-        if (m)
                 manager_free(m);
 
         return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;