[hackers] [sbase] Factor out check for WTERMSIG || sin
commit 0967d2e2785fe9c67ec13e4f474a513ab6cf3417
Author: sin <sin_AT_2f30.org>
Date: Tue Nov 11 16:32:28 2014 +0000
Factor out check for WTERMSIG
diff --git a/kill.c b/kill.c
index f792159..52c85e6 100644
--- a/kill.c
+++ b/kill.c
_AT_@ -73,6 +73,8 @@ main(int argc, char *argv[])
sig = strtol(argv[0], &end, 10);
if (*end != '\0' || errno != 0)
eprintf("%s: bad signal number\n", argv[0]);
+ if (sig > 128)
+ sig = WTERMSIG(sig);
puts(sig2name(sig));
exit(0);
} else {
_AT_@ -116,8 +118,6 @@ sig2name(int sig)
{
size_t i;
- if (sig > 128)
- sig = WTERMSIG(sig);
for (i = 0; i < LEN(sigs); i++)
if (sigs[i].sig == sig)
return sigs[i].name;
Received on Tue Nov 11 2014 - 17:34:32 CET
This archive was generated by hypermail 2.3.0
: Tue Nov 11 2014 - 17:36:11 CET