diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-03-13 21:20:47 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-03-13 23:42:17 -0400 |
commit | 3164e3cbc50b8754c51f1fdeda7a7d6cedcc39b6 (patch) | |
tree | 84d6e68c7f2b6e3cd47a9f6ae5a52015d8bbf0e6 /src/core/namespace.c | |
parent | dc75168823540076b354135f6e2de7a9a978fbca (diff) |
core: either ignore or handle mount failures
/dev/pts/ptmx is as important as /dev/pts, so error out if that
fails. Others seem less important, since the namespace is usable
without them, so ignore failures.
CID #123755, #123754.
Diffstat (limited to 'src/core/namespace.c')
-rw-r--r-- | src/core/namespace.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/namespace.c b/src/core/namespace.c index 3832503013..8155065fe4 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -164,7 +164,10 @@ static int mount_dev(BindMount *m) { } devptmx = strjoina(temporary_mount, "/dev/ptmx"); - symlink("pts/ptmx", devptmx); + if (symlink("pts/ptmx", devptmx) < 0) { + r = -errno; + goto fail; + } devshm = strjoina(temporary_mount, "/dev/shm"); (void) mkdir(devshm, 01777); @@ -176,14 +179,14 @@ static int mount_dev(BindMount *m) { devmqueue = strjoina(temporary_mount, "/dev/mqueue"); (void) mkdir(devmqueue, 0755); - mount("/dev/mqueue", devmqueue, NULL, MS_BIND, NULL); + (void) mount("/dev/mqueue", devmqueue, NULL, MS_BIND, NULL); devhugepages = strjoina(temporary_mount, "/dev/hugepages"); (void) mkdir(devhugepages, 0755); - mount("/dev/hugepages", devhugepages, NULL, MS_BIND, NULL); + (void) mount("/dev/hugepages", devhugepages, NULL, MS_BIND, NULL); devlog = strjoina(temporary_mount, "/dev/log"); - symlink("/run/systemd/journal/dev-log", devlog); + (void) symlink("/run/systemd/journal/dev-log", devlog); NULSTR_FOREACH(d, devnodes) { _cleanup_free_ char *dn = NULL; |