Found in github CI by the existing patch tests:
```
patch: xsignal 0: Invalid argument
```

When I grepped for places that would be affected by my `kill -0` change,
I grepped toys/, not lib/. (And I only ran the tests for the toys I
touched, not all the tests, and CI was already broken so we didn't
notice the new breakage until the old breakage was fixed :-( )
---
 lib/portability.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
From b1a0f288f7e117e47816851fb60126c71aad9958 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <e...@google.com>
Date: Mon, 30 Aug 2021 08:54:08 -0700
Subject: [PATCH] Fix xsignal_all_killers().

Found in github CI by the existing patch tests:
```
patch: xsignal 0: Invalid argument
```

When I grepped for places that would be affected by my `kill -0` change,
I grepped toys/, not lib/. (And I only ran the tests for the toys I
touched, not all the tests, and CI was already broken so we didn't
notice the new breakage until the old breakage was fixed :-( )
---
 lib/portability.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/portability.c b/lib/portability.c
index c95a7526..44259a34 100644
--- a/lib/portability.c
+++ b/lib/portability.c
@@ -467,7 +467,8 @@ void xsignal_all_killers(void *handler)
 
   if (!handler) handler = SIG_DFL;
   for (i = 0; signames[i].num != SIGCHLD; i++)
-    if (signames[i].num != SIGKILL) xsignal(signames[i].num, handler);
+    if (signames[i].num && signames[i].num != SIGKILL)
+      xsignal(signames[i].num, handler);
 }
 
 // Convert a string like "9", "KILL", "SIGHUP", or "SIGRTMIN+2" to a number.
-- 
2.33.0.259.gc128427fd7-goog

_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to