chiark / gitweb /
Prep v231: Apply missing fixes from upstream (3/6) src/libelogind
[elogind.git] / src / login / logind.c
index 4c0b1df0e9e915bfbba36fbd1e59923962372dc1..b976981006a77e8fe2ce1882269ee3e1e66326a9 100644 (file)
@@ -78,8 +78,8 @@ static void manager_reset_config(Manager *m) {
         m->idle_action_usec = 30 * USEC_PER_MINUTE;
         m->idle_action = HANDLE_IGNORE;
 
-        m->runtime_dir_size = PAGE_ALIGN((size_t) (physical_memory() / 10)); /* 10% */
-        m->user_tasks_max = 12288;
+        m->runtime_dir_size = physical_memory_scale(10U, 100U); /* 10% */
+        m->user_tasks_max = system_tasks_max_scale(33U, 100U); /* 33% */
         m->sessions_max = 8192;
         m->inhibitors_max = 8192;
 
@@ -1392,7 +1392,8 @@ finish:
                   "STOPPING=1\n"
                   "STATUS=Shutting down...");
 
-        manager_free(m);
+        if (m)
+                manager_free(m);
 
         return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
 }