core:namespace: minor improvements to append_mounts()

This commit is contained in:
Djalal Harouni 2016-09-25 11:03:21 +02:00
parent cefc33aee2
commit 9c94d52e09
1 changed files with 4 additions and 4 deletions

View File

@ -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)++;
}