]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: put more struct members into designated initializer
authorMike Yuan <me@yhndnzj.com>
Fri, 3 Nov 2023 18:06:28 +0000 (02:06 +0800)
committerMike Yuan <me@yhndnzj.com>
Tue, 5 Dec 2023 14:18:32 +0000 (22:18 +0800)
src/login/logind.c

index a44b5933064d53c90b07224bcfe8d9f5d99cc42e..965e2a4aefe9cfcb251b3fbdf5204f74a878dd01 100644 (file)
@@ -66,17 +66,17 @@ static int manager_new(Manager **ret) {
                 .enable_wall_messages = true,
                 .idle_action_not_before_usec = now(CLOCK_MONOTONIC),
                 .scheduled_shutdown_action = _HANDLE_ACTION_INVALID,
-        };
 
-        m->devices = hashmap_new(&device_hash_ops);
-        m->seats = hashmap_new(&seat_hash_ops);
-        m->sessions = hashmap_new(&session_hash_ops);
-        m->users = hashmap_new(&user_hash_ops);
-        m->inhibitors = hashmap_new(&inhibitor_hash_ops);
-        m->buttons = hashmap_new(&button_hash_ops);
+                .devices = hashmap_new(&device_hash_ops),
+                .seats = hashmap_new(&seat_hash_ops),
+                .sessions = hashmap_new(&session_hash_ops),
+                .users = hashmap_new(&user_hash_ops),
+                .inhibitors = hashmap_new(&inhibitor_hash_ops),
+                .buttons = hashmap_new(&button_hash_ops),
 
-        m->user_units = hashmap_new(&string_hash_ops);
-        m->session_units = hashmap_new(&string_hash_ops);
+                .user_units = hashmap_new(&string_hash_ops),
+                .session_units = hashmap_new(&string_hash_ops),
+        };
 
         if (!m->devices || !m->seats || !m->sessions || !m->users || !m->inhibitors || !m->buttons || !m->user_units || !m->session_units)
                 return -ENOMEM;