* kill.cc (main): Allow negative pids (indicates process groups).
This commit is contained in:
parent
0199487e6a
commit
7ed1b504b6
@ -1,3 +1,7 @@
|
||||
2003-09-20 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* kill.cc (main): Allow negative pids (indicates process groups).
|
||||
|
||||
2003-09-17 Christopher Faylor <cgf@redhat.com>
|
||||
|
||||
* parse_pe.cc (exclusion::sort_and_check): Make error message a little
|
||||
|
@ -164,6 +164,10 @@ main (int argc, char **argv)
|
||||
usage ();
|
||||
|
||||
opterr = 0;
|
||||
|
||||
char *p;
|
||||
int pid = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int ch;
|
||||
@ -201,7 +205,12 @@ main (int argc, char **argv)
|
||||
break;
|
||||
case '?':
|
||||
if (gotasig)
|
||||
usage ();
|
||||
{
|
||||
pid = strtol (argv[optind], &p, 10);
|
||||
if (pid < 0)
|
||||
goto out;
|
||||
usage ();
|
||||
}
|
||||
optreset = 1;
|
||||
optind = 1 + av - argv;
|
||||
gotasig = *av + 1;
|
||||
@ -213,13 +222,14 @@ main (int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
test_for_unknown_sig (sig, gotasig);
|
||||
|
||||
argv += optind;
|
||||
while (*argv != NULL)
|
||||
{
|
||||
char *p;
|
||||
int pid = strtol (*argv, &p, 10);
|
||||
if (!pid)
|
||||
pid = strtol (*argv, &p, 10);
|
||||
if (*p != '\0')
|
||||
{
|
||||
fprintf (stderr, "%s: illegal pid: %s\n", prog_name, *argv);
|
||||
@ -240,6 +250,7 @@ main (int argc, char **argv)
|
||||
ret = 1;
|
||||
}
|
||||
argv++;
|
||||
pid = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user