diff options
author | jilles <jilles@FreeBSD.org> | 2014-03-15 14:58:48 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2014-03-15 14:58:48 +0000 |
commit | 94dae0aff1dddebb566cf2f69548fd9f50be8c78 (patch) | |
tree | f8932801a36ad6f4a3bffeaa6e0fb25e14c758c1 /bin/sh/tests/builtins | |
parent | ad4ea38baed6b320d50d678342cee3364eaf6692 (diff) | |
download | FreeBSD-src-94dae0aff1dddebb566cf2f69548fd9f50be8c78.zip FreeBSD-src-94dae0aff1dddebb566cf2f69548fd9f50be8c78.tar.gz |
sh: Allow kill %job on jobs started without job control.
When killing a %job started without job control, kill all processes in it.
As with process groups and zombies, if any process in the job can be killed
or has already terminated, the command is successful.
This also fixes occasional failures of the builtins/kill1.0 test.
Diffstat (limited to 'bin/sh/tests/builtins')
-rw-r--r-- | bin/sh/tests/builtins/Makefile | 2 | ||||
-rw-r--r-- | bin/sh/tests/builtins/kill2.0 | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/bin/sh/tests/builtins/Makefile b/bin/sh/tests/builtins/Makefile index b76d631..945a14d 100644 --- a/bin/sh/tests/builtins/Makefile +++ b/bin/sh/tests/builtins/Makefile @@ -86,7 +86,7 @@ FILES+= hash3.0 hash3.0.stdout FILES+= hash4.0 FILES+= jobid1.0 FILES+= jobid2.0 -FILES+= kill1.0 +FILES+= kill1.0 kill2.0 FILES+= lineno.0 lineno.0.stdout FILES+= lineno2.0 FILES+= local1.0 diff --git a/bin/sh/tests/builtins/kill2.0 b/bin/sh/tests/builtins/kill2.0 new file mode 100644 index 0000000..31e0ba3 --- /dev/null +++ b/bin/sh/tests/builtins/kill2.0 @@ -0,0 +1,7 @@ +# $FreeBSD$ + +sleep 1 | sleep 1 & +kill %+ +wait "$!" +r=$? +[ "$r" -gt 128 ] && [ "$(kill -l "$r")" = TERM ] |