summaryrefslogtreecommitdiff
path: root/src/fstab-generator
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-11-28 20:11:52 +0100
committerLennart Poettering <lennart@poettering.net>2017-12-05 13:49:13 +0100
commit6c782b7a47ad9a8dcabd7218a43626293694c27b (patch)
tree3a68c38d3978cffe5a5890624cbbf6ded24ff19e /src/fstab-generator
parent8fe9c8d9200f1b5e1bdd5f7bdf38d6a37b7412e7 (diff)
downloadsystemd-6c782b7a47ad9a8dcabd7218a43626293694c27b.tar.gz
fstab-generator: port some code to strextend_with_separator()
Diffstat (limited to 'src/fstab-generator')
-rw-r--r--src/fstab-generator/fstab-generator.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 68e7c23cbe..c0886547e0 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -820,19 +820,13 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
return log_oom();
} else if (streq(key, "rootflags")) {
- char *o;
if (proc_cmdline_value_missing(key, value))
return 0;
- o = arg_root_options ?
- strjoin(arg_root_options, ",", value) :
- strdup(value);
- if (!o)
+ if (!strextend_with_separator(&arg_root_options, ",", value, NULL))
return log_oom();
- free(arg_root_options);
- arg_root_options = o;
} else if (streq(key, "roothash")) {
if (proc_cmdline_value_missing(key, value))
@@ -858,20 +852,13 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
return log_oom();
} else if (streq(key, "mount.usrflags")) {
- char *o;
if (proc_cmdline_value_missing(key, value))
return 0;
- o = arg_usr_options ?
- strjoin(arg_usr_options, ",", value) :
- strdup(value);
- if (!o)
+ if (!strextend_with_separator(&arg_usr_options, ",", value, NULL))
return log_oom();
- free(arg_usr_options);
- arg_usr_options = o;
-
} else if (streq(key, "rw") && !value)
arg_root_rw = true;
else if (streq(key, "ro") && !value)