From 9e278ffd2cfe03a1e83e09d30aa0c361905c29f8 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 12 Oct 2009 16:01:44 +0000 Subject: [PATCH] * kill.cc (main): Skip to PID loop on invalid option to handle negative pids there. --- winsup/utils/ChangeLog | 5 +++++ winsup/utils/kill.cc | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 215706162..f3d05d9b2 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,8 @@ +2009-10-12 Corinna Vinschen + + * kill.cc (main): Skip to PID loop on invalid option to handle + negative pids there. + 2009-08-11 Corinna Vinschen * mkgroup.c (enum_local_groups): Avoid error message if given group diff --git a/winsup/utils/kill.cc b/winsup/utils/kill.cc index f43ef7762..35ed128d0 100644 --- a/winsup/utils/kill.cc +++ b/winsup/utils/kill.cc @@ -249,10 +249,8 @@ main (int argc, char **argv) case '?': if (gotasig) { - pid = strtoll (argv[optind], &p, 10); - if (pid < 0) - goto out; - usage (); + --optind; + goto out; } optreset = 1; optind = 1 + av - argv;