]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
varlink: apparently on old kernels SO_PEERPIDFD returns EINVAL
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Nov 2024 11:14:59 +0000 (12:14 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 22 Nov 2024 18:09:49 +0000 (03:09 +0900)
src/libsystemd/sd-varlink/varlink-util.c

index 971be643e82f62c4a840956d4c4d78a5056f01d4..b16d4bddb6c917f9bbd83de1f128ae3ad5e22726 100644 (file)
@@ -16,7 +16,7 @@ int varlink_get_peer_pidref(sd_varlink *v, PidRef *ret) {
 
         int pidfd = sd_varlink_get_peer_pidfd(v);
         if (pidfd < 0) {
-                if (!ERRNO_IS_NEG_NOT_SUPPORTED(pidfd))
+                if (!ERRNO_IS_NEG_NOT_SUPPORTED(pidfd) && pidfd != -EINVAL)
                         return pidfd;
 
                 pid_t pid;