namespace: simplify mount_path_compare() a bit

This commit is contained in:
Lennart Poettering
2016-09-25 10:19:10 +02:00
committed by Djalal Harouni
parent 3fbe8dbe41
commit 6ee1a919cf
+12 -14
View File
@@ -93,21 +93,19 @@ static int mount_path_compare(const void *a, const void *b) {
const BindMount *p = a, *q = b;
int d;
d = path_compare(p->path, q->path);
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;
return 0;
}
/* If the paths are not equal, then order prefixes first */
return d;
d = path_compare(p->path, q->path);
if (d != 0)
return d;
/* If the paths are equal, check the mode */
if (p->mode < q->mode)
return -1;
if (p->mode > q->mode)
return 1;
return 0;
}
static void drop_duplicates(BindMount *m, unsigned *n) {