namepace: fix error handling when clone_device_node() returns 0

Before this patch, we'd treat clone_device_node() returning 0 (as
opposed to 1) as error, but then propagate this non-error result in
confusion.

This makes sure that if we ptmx isn't around we propagate that as
-ENXIO.

This is a follow-up for 98b1d2b8d9
This commit is contained in:
Lennart Poettering 2018-01-23 19:37:59 +01:00
parent 36ce7110b0
commit 152c475f95
1 changed files with 5 additions and 1 deletions

View File

@ -578,8 +578,12 @@ static int mount_private_dev(MountEntry *m) {
}
} else {
r = clone_device_node("/dev/ptmx", temporary_mount);
if (r != 1)
if (r < 0)
goto fail;
if (r == 0) {
r = -ENXIO;
goto fail;
}
}
devshm = strjoina(temporary_mount, "/dev/shm");