From 4808da77b5e8fd6f1aa3aeb83c0d53f31016c97c Mon Sep 17 00:00:00 2001 From: herbert Date: Sat, 7 Aug 2004 13:48:42 +1000 Subject: Allow negative pid argument to kill(1) in src/jobs.c. --- ChangeLog | 4 ++++ src/jobs.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 180755e..2865f0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-08-07 Herbert Xu + + * Allow negative pid argument to kill(1) in src/jobs.c. + 2004-08-04 Herbert Xu * Fixed cd - when OLDPWD is unset in src/cd.c. diff --git a/src/jobs.c b/src/jobs.c index 10d3cfd..132c47a 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -328,7 +328,8 @@ usage: jp = getjob(*argv, 0); pid = -jp->ps[0].pid; } else - pid = number(*argv); + pid = **argv == '-' ? + -number(*argv + 1) : number(*argv); if (kill(pid, signo) != 0) { sh_warnx("%s\n", strerror(errno)); i = 1; -- cgit 1.4.1