]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/mount-util: log correct errno 29650/head
authorMike Yuan <me@yhndnzj.com>
Fri, 20 Oct 2023 04:09:06 +0000 (12:09 +0800)
committerMike Yuan <me@yhndnzj.com>
Fri, 20 Oct 2023 22:25:36 +0000 (06:25 +0800)
Follow-up for 5f48198af82e5a6f40adf887291fdd47bcecf64c

src/shared/mount-util.c

index e385f2177736f8718dbb05c6f162aee1d9c9e3d6..b7ac03f5aeb0b28d8fcae9ee5f1648d0ba56ea0e 100644 (file)
@@ -1107,8 +1107,9 @@ static int mount_in_namespace(
         if (r > 0)
                 return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to activate bind mount in target, not running in a mount namespace");
 
-        if (pidref_verify(target) < 0)
-                return log_debug_errno(SYNTHETIC_ERRNO(ESRCH), "Failed to verify target process '" PID_FMT "': %m", target->pid);
+        r = pidref_verify(target);
+        if (r < 0)
+                return log_debug_errno(r, "Failed to verify target process '" PID_FMT "': %m", target->pid);
 
         r = chase(src, NULL, 0, &chased_src_path, &chased_src_fd);
         if (r < 0)