summaryrefslogtreecommitdiff
path: root/src/nspawn/nspawn-mount.c
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2022-07-11 21:38:26 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2022-07-11 21:38:26 +0200
commita50947c56b41371e60801049a6a3025fad019411 (patch)
tree66d74e3ff8a2aa1d872b1129323ac3f88ad71054 /src/nspawn/nspawn-mount.c
parent81a965187d01542a965daad7523993f4386fbc2d (diff)
downloadsystemd-a50947c56b41371e60801049a6a3025fad019411.tar.gz
nspawn: Drop unnecessary intermediate variable
Diffstat (limited to 'src/nspawn/nspawn-mount.c')
-rw-r--r--src/nspawn/nspawn-mount.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c
index 6378e1b703..26a2cc9e7e 100644
--- a/src/nspawn/nspawn-mount.c
+++ b/src/nspawn/nspawn-mount.c
@@ -213,14 +213,13 @@ int custom_mount_prepare_all(const char *dest, CustomMount *l, size_t n) {
int bind_mount_parse(CustomMount **l, size_t *n, const char *s, bool read_only) {
_cleanup_free_ char *source = NULL, *destination = NULL, *opts = NULL;
- const char *p = s;
CustomMount *m;
int r;
assert(l);
assert(n);
- r = extract_many_words(&p, ":", EXTRACT_DONT_COALESCE_SEPARATORS, &source, &destination, NULL);
+ r = extract_many_words(&s, ":", EXTRACT_DONT_COALESCE_SEPARATORS, &source, &destination, NULL);
if (r < 0)
return r;
if (r == 0)
@@ -230,8 +229,8 @@ int bind_mount_parse(CustomMount **l, size_t *n, const char *s, bool read_only)
if (!destination)
return -ENOMEM;
}
- if (r == 2 && !isempty(p)) {
- opts = strdup(p);
+ if (r == 2 && !isempty(s)) {
+ opts = strdup(s);
if (!opts)
return -ENOMEM;
}