diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-08-24 11:16:40 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-08-31 22:53:14 +0200 |
commit | efc90b98142889d443a86c18304f1b13ebda9ddb (patch) | |
tree | 558bde18a78bb365b7c144881c8b8262fcac4204 /src/shutdown | |
parent | 83f3bf4b6f345c71505a5def3794672f3deea49b (diff) | |
download | systemd-efc90b98142889d443a86c18304f1b13ebda9ddb.tar.gz |
umount: use structured initialization
Diffstat (limited to 'src/shutdown')
-rw-r--r-- | src/shutdown/umount.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/shutdown/umount.c b/src/shutdown/umount.c index 9e9888bce8..6d133d5761 100644 --- a/src/shutdown/umount.c +++ b/src/shutdown/umount.c @@ -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)); } |