summaryrefslogtreecommitdiffstats
path: root/src/fstab-generator
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-03-19 21:08:52 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2024-03-20 15:18:21 +0100
commit6a705f1234919c255cc230403ad6749edabf83be (patch)
tree325220dfa5cf279a7ce9af3babf04631d90fc2d2 /src/fstab-generator
parentbasic/string-util: use strdup_to() in string_extract_line() (diff)
downloadsystemd-6a705f1234919c255cc230403ad6749edabf83be.tar.xz
systemd-6a705f1234919c255cc230403ad6749edabf83be.zip
Replace strdup_or_null() by strdup_to()
I didn't know that this helper existed… It is very similar to strdup_to_full(), but all callers can actually be replaced by strdup_to(), which has more fitting semantics.
Diffstat (limited to 'src/fstab-generator')
-rw-r--r--src/fstab-generator/fstab-generator.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index e4c8c9674c..b4df9d23c2 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -498,13 +498,8 @@ static int mandatory_mount_drop_unapplicable_options(
assert(where);
assert(ret_options);
- if (!(*flags & (MOUNT_NOAUTO|MOUNT_NOFAIL|MOUNT_AUTOMOUNT))) {
- r = strdup_or_null(options, ret_options);
- if (r < 0)
- return r;
-
- return 0;
- }
+ if (!(*flags & (MOUNT_NOAUTO|MOUNT_NOFAIL|MOUNT_AUTOMOUNT)))
+ return strdup_to(ret_options, options);
log_debug("Mount '%s' is mandatory, ignoring 'noauto', 'nofail', and 'x-systemd.automount' options.",
where);