chiark / gitweb /
log: also set errno to the passed error code before processing format string in log_s...
[elogind.git] / src / login / logind.c
index 1f94a97bd0500bc17c5db2934c6e873067a5a560..69b219d89e6a9d9acc6e97d7387c4d412e0d61fb 100644 (file)
@@ -64,17 +64,17 @@ Manager *manager_new(void) {
 
         m->runtime_dir_size = PAGE_ALIGN((size_t) (physical_memory() / 10)); /* 10% */
 
-        m->devices = hashmap_new(string_hash_func, string_compare_func);
-        m->seats = hashmap_new(string_hash_func, string_compare_func);
-        m->sessions = hashmap_new(string_hash_func, string_compare_func);
-        m->users = hashmap_new(trivial_hash_func, trivial_compare_func);
-        m->inhibitors = hashmap_new(string_hash_func, string_compare_func);
-        m->buttons = hashmap_new(string_hash_func, string_compare_func);
+        m->devices = hashmap_new(&string_hash_ops);
+        m->seats = hashmap_new(&string_hash_ops);
+        m->sessions = hashmap_new(&string_hash_ops);
+        m->users = hashmap_new(NULL);
+        m->inhibitors = hashmap_new(&string_hash_ops);
+        m->buttons = hashmap_new(&string_hash_ops);
 
-        m->user_units = hashmap_new(string_hash_func, string_compare_func);
-        m->session_units = hashmap_new(string_hash_func, string_compare_func);
+        m->user_units = hashmap_new(&string_hash_ops);
+        m->session_units = hashmap_new(&string_hash_ops);
 
-        m->busnames = set_new(string_hash_func, string_compare_func);
+        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)
@@ -750,11 +750,11 @@ static int manager_vt_switch(sd_event_source *src, const struct signalfd_siginfo
         }
 
         if (active->vtfd >= 0) {
-                ioctl(active->vtfd, VT_RELDISP, 1);
+                session_leave_vt(active);
         } else {
                 LIST_FOREACH(sessions_by_seat, iter, m->seat0->sessions) {
                         if (iter->vtnr == active->vtnr && iter->vtfd >= 0) {
-                                ioctl(iter->vtfd, VT_RELDISP, 1);
+                                session_leave_vt(iter);
                                 break;
                         }
                 }
@@ -1171,10 +1171,11 @@ int manager_run(Manager *m) {
 static int manager_parse_config_file(Manager *m) {
         assert(m);
 
-        return config_parse(NULL, "/etc/systemd/logind.conf", NULL,
-                            "Login\0",
-                            config_item_perf_lookup, logind_gperf_lookup,
-                            false, false, true, m);
+        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);
 }
 
 int main(int argc, char *argv[]) {