kill: accept $? values

This commit is contained in:
Connor Lane Smith 2011-06-21 04:56:16 +01:00
parent 914ad7b733
commit 04162bd7b0
1 changed files with 3 additions and 0 deletions

3
kill.c
View File

@ -5,6 +5,7 @@
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include <sys/wait.h>
#include "util.h"
#define LEN(x) (sizeof (x) / sizeof *(x))
@ -54,6 +55,8 @@ main(int argc, char *argv[])
" %s -l [signum]\n", argv[0], argv[0]);
sig = (optind == argc) ? 0 : estrtol(argv[optind], 0);
if(sig > 128)
sig = WTERMSIG(sig);
for(i = 0; i < LEN(sigs); i++)
if(sigs[i].sig == sig || sig == 0)
putword(sigs[i].name);