]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pidref: propagate critical errors in pidref_acquire_pidfd_id()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 12 Jul 2025 07:19:51 +0000 (16:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 12 Jul 2025 10:51:01 +0000 (19:51 +0900)
Follow-up for 571867ffa76c7829d3901386aa43294852a0363c.

Fixes CID#1612242.

src/basic/pidref.c

index 7f66496dd3f9c82c1d73cafe2e61dd4547db36e3..2d19dea60e83e6c52a88acffdabfb2a4a121ad60 100644 (file)
@@ -133,7 +133,9 @@ int pidref_set_pid_and_pidfd_id(
                 return r;
 
         if (pidfd_id > 0) {
-                pidref_acquire_pidfd_id(&n);
+                r = pidref_acquire_pidfd_id(&n);
+                if (r < 0 && !ERRNO_IS_NEG_NOT_SUPPORTED(r))
+                        return r;
 
                 if (n.fd_id != pidfd_id)
                         return -ESRCH;