diff options
author | Djalal Harouni <tixxdz@opendz.org> | 2016-09-25 11:03:21 +0200 |
---|---|---|
committer | Djalal Harouni <tixxdz@opendz.org> | 2016-09-25 11:03:21 +0200 |
commit | 9c94d52e0919e4d7999e49b9ba2654a9e2ca4543 (patch) | |
tree | 8b84e2d5a6acecc782fe2587e76c7a3cc45dee49 /src/core | |
parent | cefc33aee299fa214f093d3d1b4c171ac3b30dde (diff) |
core:namespace: minor improvements to append_mounts()
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/namespace.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/namespace.c b/src/core/namespace.c index c9b2154985..8de774e6f6 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -70,12 +70,11 @@ static int append_mounts(BindMount **p, char **strv, MountMode mode) { assert(p); STRV_FOREACH(i, strv) { + bool ignore = false; - (*p)->ignore = false; - - if ((mode == INACCESSIBLE || mode == READONLY || mode == READWRITE) && (*i)[0] == '-') { - (*p)->ignore = true; + if (IN_SET(mode, INACCESSIBLE, READONLY, READWRITE) && startswith(*i, "-")) { (*i)++; + ignore = true; } if (!path_is_absolute(*i)) @@ -83,6 +82,7 @@ static int append_mounts(BindMount **p, char **strv, MountMode mode) { (*p)->path = *i; (*p)->mode = mode; + (*p)->ignore = ignore; (*p)++; } |