summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/namespace.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/core/namespace.c b/src/core/namespace.c
index 102fe576f3..74201caa10 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -93,21 +93,19 @@ static int mount_path_compare(const void *a, const void *b) {
const BindMount *p = a, *q = b;
int d;
+ /* If the paths are not equal, then order prefixes first */
d = path_compare(p->path, q->path);
+ if (d != 0)
+ return d;
- if (d == 0) {
- /* If the paths are equal, check the mode */
- if (p->mode < q->mode)
- return -1;
-
- if (p->mode > q->mode)
- return 1;
+ /* If the paths are equal, check the mode */
+ if (p->mode < q->mode)
+ return -1;
- return 0;
- }
+ if (p->mode > q->mode)
+ return 1;
- /* If the paths are not equal, then order prefixes first */
- return d;
+ return 0;
}
static void drop_duplicates(BindMount *m, unsigned *n) {