Description: killal pidfd_send_signal fall through
 If pidfd_send_signal() is not available at run time use kill instead.
Author: Craig Small <csmall@debian.org>
Bug-Debian: https://bugs.debian.org/1015228
Applied-Upstream: https://gitlab.com/psmisc/psmisc/-/commit/6892e321e7042e3df60a5501a1c59d076e8a856f
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2022-07-18
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/killall.c
+++ b/src/killall.c
@@ -326,7 +326,12 @@
 {
 #ifdef __NR_pidfd_send_signal
     if (pid > 0) /* Not PGID */
-        return syscall(__NR_pidfd_send_signal, pidfd, sig, NULL, 0);
+	    {
+        int ret = syscall(__NR_pidfd_send_signal, pidfd, sig, NULL, 0);
+        if (ret >= 0 || errno != ENOSYS)
+            return ret;
+        // fall through if no such syscall
+    }
 #endif
     return kill(pid, sig);
 }
