summaryrefslogtreecommitdiffstats
path: root/bin/kill
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-06-13 08:07:20 +0000
committertjr <tjr@FreeBSD.org>2002-06-13 08:07:20 +0000
commit313635fc7e53a3aa606882f1adb1174b94896cd0 (patch)
tree9c12f0741b05756268930c250b401cb0afd8dc7f /bin/kill
parent08e98db385e632c06fd36a487b2112e0ccaa1306 (diff)
downloadFreeBSD-src-313635fc7e53a3aa606882f1adb1174b94896cd0.zip
FreeBSD-src-313635fc7e53a3aa606882f1adb1174b94896cd0.tar.gz
Support the "--" end of options marker, useful to disambiguate between
signal numbers and process groups (negative pid arguments), and required by SUSv3.
Diffstat (limited to 'bin/kill')
-rw-r--r--bin/kill/kill.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/kill/kill.c b/bin/kill/kill.c
index 48198c8..865c9db 100644
--- a/bin/kill/kill.c
+++ b/bin/kill/kill.c
@@ -103,7 +103,7 @@ main(int argc, char *argv[])
} else
numsig = 0;
argc--, argv++;
- } else if (**argv == '-') {
+ } else if (**argv == '-' && *(*argv + 1) != '-') {
++*argv;
if (isalpha(**argv)) {
if ((numsig = signame_to_signum(*argv)) < 0)
@@ -119,6 +119,9 @@ main(int argc, char *argv[])
argc--, argv++;
}
+ if (argc > 0 && strncmp(*argv, "--", 2) == 0)
+ argc--, argv++;
+
if (argc == 0)
usage();
OpenPOWER on IntegriCloud