commit 0967d2e2785fe9c67ec13e4f474a513ab6cf3417
parent e0b0741ba1c533bbcf7e9aef217aa5f26e2cdaa4
Author: sin <sin@2f30.org>
Date: Tue, 11 Nov 2014 16:32:28 +0000
Factor out check for WTERMSIG
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kill.c b/kill.c
@@ -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 {
@@ -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;