Re-work r260800 to include other signals which start with 'I'

such as ILL, INFO etc..

Submitted by:	delphij
MFC after:	2 weeks
This commit is contained in:
csjp 2014-01-17 04:16:39 +00:00
parent 0728e663d0
commit d34702f4cf

View File

@ -90,6 +90,7 @@ nosig(char *name)
int
main(int ac, char **av)
{
char **saved_av;
struct kinfo_proc *procs, *newprocs;
struct stat sb;
struct passwd *pw;
@ -210,16 +211,8 @@ main(int ac, char **av)
case 'z':
zflag++;
break;
case 'I':
/*
* NB: do not confuse -INT with -I
*/
if (strncmp(*av, "INT", 3) != 0) {
Iflag = 1;
break;
}
/* FALLTHROUGH */
default:
saved_av = av;
if (isalpha((unsigned char)**av)) {
if (strncasecmp(*av, "SIG", 3) == 0)
*av += 3;
@ -229,8 +222,14 @@ main(int ac, char **av)
sig = p - sys_signame;
break;
}
if (!sig)
nosig(*av);
if (!sig) {
if (**saved_av == 'I') {
av = saved_av;
Iflag = 1;
break;
} else
nosig(*av);
}
} else if (isdigit((unsigned char)**av)) {
sig = strtol(*av, &ep, 10);
if (!*av || *ep)