chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nspawn: change filesystem type from "bind" to NULL in mount() syscalls
[elogind.git]
/
src
/
core
/
namespace.c
diff --git
a/src/core/namespace.c
b/src/core/namespace.c
index 8155065fe42c5073f7ced1786ef9cf2ef9086cbc..718da2384dc21adc294384d26941b7ec7d11713b 100644
(file)
--- a/
src/core/namespace.c
+++ b/
src/core/namespace.c
@@
-83,9
+83,11
@@
static int append_mounts(BindMount **p, char **strv, MountMode mode) {
static int mount_path_compare(const void *a, const void *b) {
const BindMount *p = a, *q = b;
static int mount_path_compare(const void *a, const void *b) {
const BindMount *p = a, *q = b;
+ int d;
- if (path_equal(p->path, q->path)) {
+ d = path_compare(p->path, q->path);
+ if (!d) {
/* If the paths are equal, check the mode */
if (p->mode < q->mode)
return -1;
/* If the paths are equal, check the mode */
if (p->mode < q->mode)
return -1;
@@
-97,13
+99,7
@@
static int mount_path_compare(const void *a, const void *b) {
}
/* If the paths are not equal, then order prefixes first */
}
/* If the paths are not equal, then order prefixes first */
- if (path_startswith(p->path, q->path))
- return 1;
-
- if (path_startswith(q->path, p->path))
- return -1;
-
- return 0;
+ return d;
}
static void drop_duplicates(BindMount *m, unsigned *n) {
}
static void drop_duplicates(BindMount *m, unsigned *n) {
@@
-297,7
+293,7
@@
static int mount_kdbus(BindMount *m) {
goto fail;
}
goto fail;
}
- r = mount(m->path, busnode,
"bind"
, MS_BIND, NULL);
+ r = mount(m->path, busnode,
NULL
, MS_BIND, NULL);
if (r < 0) {
log_error_errno(errno, "bind mount of %s failed: %m", m->path);
r = -errno;
if (r < 0) {
log_error_errno(errno, "bind mount of %s failed: %m", m->path);
r = -errno;
@@
-527,7
+523,7
@@
fail:
if (n > 0) {
for (m = mounts; m < mounts + n; ++m)
if (m->done)
if (n > 0) {
for (m = mounts; m < mounts + n; ++m)
if (m->done)
- umount2(m->path, MNT_DETACH);
+
(void)
umount2(m->path, MNT_DETACH);
}
return r;
}
return r;