aboutsummaryrefslogtreecommitdiff
path: root/bin/kill
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-04-28 07:50:45 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-04-28 07:50:45 +0000
commit3b8f08459569bf0faa21473e5cec2491e95c9349 (patch)
tree80f45dd81ca716bcd7ca9674581e1fc40b93cd34 /bin/kill
parent9d2ab4a62d6733c45958627ac113bdbd818d1e2a (diff)
parentb2ba55951383498f252746f618d513139da06e8e (diff)
downloadsrc-3b8f08459569bf0faa21473e5cec2491e95c9349.tar.gz
src-3b8f08459569bf0faa21473e5cec2491e95c9349.zip
Merge head
Notes
Notes: svn path=/projects/bmake/; revision=265044
Diffstat (limited to 'bin/kill')
-rw-r--r--bin/kill/kill.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/kill/kill.c b/bin/kill/kill.c
index 2d41f7865e48..b23c00acf21c 100644
--- a/bin/kill/kill.c
+++ b/bin/kill/kill.c
@@ -67,7 +67,7 @@ static void usage(void);
int
main(int argc, char *argv[])
{
- int errors, numsig, pid;
+ int errors, numsig, pid, ret;
char *ep;
if (argc < 2)
@@ -134,15 +134,16 @@ main(int argc, char *argv[])
for (errors = 0; argc; argc--, argv++) {
#ifdef SHELL
if (**argv == '%')
- pid = getjobpgrp(*argv);
+ ret = killjob(*argv, numsig);
else
#endif
{
pid = strtol(*argv, &ep, 10);
if (!**argv || *ep)
errx(2, "illegal process id: %s", *argv);
+ ret = kill(pid, numsig);
}
- if (kill(pid, numsig) == -1) {
+ if (ret == -1) {
warn("%s", *argv);
errors = 1;
}