From 0f095d0b8f4150f62d9670f0db70845c5e57c9be Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Fri, 20 Oct 2023 12:09:06 +0800 Subject: [PATCH] shared/mount-util: log correct errno Follow-up for 5f48198af82e5a6f40adf887291fdd47bcecf64c --- src/shared/mount-util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c index e385f217773..b7ac03f5aeb 100644 --- a/src/shared/mount-util.c +++ b/src/shared/mount-util.c @@ -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) -- 2.47.3