shutdown: return correct errors after pipe2()

The functions returned -EPERM for every failure. The callers only test
for a negative value, so this is cosmetic.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek committed 2026-11-04 00:27:25 +01:00
1 parent 8087660ccc
commit 4a2967f950
1 file changed
+4 -6
+4 -6
View File
@@ -255,9 +255,8 @@ static int remount_with_timeout(MountPoint *m, bool last_try) {
assert(m);
r = pipe2(pfd, O_CLOEXEC|O_NONBLOCK);
if (r < 0)
return r;
if (pipe2(pfd, O_CLOEXEC|O_NONBLOCK) < 0)
return -errno;
/* Due to the possibility of a remount operation hanging, we fork a child process and set a
* timeout. If the timeout lapses, the assumption is that the particular remount failed. */
@@ -317,9 +316,8 @@ static int umount_with_timeout(MountPoint *m, bool last_try) {
assert(m);
r = pipe2(pfd, O_CLOEXEC|O_NONBLOCK);
if (r < 0)
return r;
if (pipe2(pfd, O_CLOEXEC|O_NONBLOCK) < 0)
return -errno;
/* Due to the possibility of a umount operation hanging, we fork a child process and set a
* timeout. If the timeout lapses, the assumption is that the particular umount failed. */