]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic: Add debug logging for pidref_set_pid()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 29 May 2024 19:04:13 +0000 (21:04 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 29 May 2024 19:04:13 +0000 (21:04 +0200)
src/basic/pidref.c

index ae04dd72a4b532e9291c9417c79f69b997165af9..69a010210dde64bd0d75a2ec62801df87d64d477 100644 (file)
@@ -54,7 +54,7 @@ int pidref_set_pid(PidRef *pidref, pid_t pid) {
         if (fd < 0) {
                 /* Graceful fallback in case the kernel doesn't support pidfds or is out of fds */
                 if (!ERRNO_IS_NOT_SUPPORTED(errno) && !ERRNO_IS_PRIVILEGE(errno) && !ERRNO_IS_RESOURCE(errno))
-                        return -errno;
+                        return log_debug_errno(errno, "Failed to open pidfd for pid " PID_FMT ": %m", pid);
 
                 fd = -EBADF;
         }