]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
umount: use structured initialization
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Aug 2022 09:16:40 +0000 (11:16 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 31 Aug 2022 20:53:14 +0000 (22:53 +0200)
src/shutdown/umount.c

index 9e9888bce8ed73e7a67d873213a13dd4b2ce246b..6d133d576194a67cf7eacd94e95f278250c86ef6 100644 (file)
@@ -151,17 +151,21 @@ int mount_points_list_get(const char *mountinfo, MountPoint **head) {
                         remount_flags = (remount_flags|MS_REMOUNT|MS_RDONLY) & ~MS_BIND;
                 }
 
-                m = new0(MountPoint, 1);
+                m = new(MountPoint, 1);
                 if (!m)
                         return log_oom();
 
+                *m = (MountPoint) {
+                        .remount_options = remount_options,
+                        .remount_flags = remount_flags,
+                        .try_remount_ro = try_remount_ro,
+                };
+
                 m->path = strdup(path);
                 if (!m->path)
                         return log_oom();
 
-                m->remount_options = TAKE_PTR(remount_options);
-                m->remount_flags = remount_flags;
-                m->try_remount_ro = try_remount_ro;
+                TAKE_PTR(remount_options);
 
                 LIST_PREPEND(mount_point, *head, TAKE_PTR(m));
         }