aboutsummaryrefslogtreecommitdiff
path: root/bin/kill/kill.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/kill/kill.c')
-rw-r--r--bin/kill/kill.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/kill/kill.c b/bin/kill/kill.c
index 2d41f7865e48..ab1701e03bdb 100644
--- a/bin/kill/kill.c
+++ b/bin/kill/kill.c
@@ -133,9 +133,15 @@ main(int argc, char *argv[])
for (errors = 0; argc; argc--, argv++) {
#ifdef SHELL
- if (**argv == '%')
+ if (**argv == '%') {
pid = getjobpgrp(*argv);
- else
+ /*
+ * Silently ignore terminated jobs, like the kernel
+ * silently ignores zombies.
+ */
+ if (pid == 0)
+ continue;
+ } else
#endif
{
pid = strtol(*argv, &ep, 10);