]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r208489,r216208: sh: Reap any zombies before forking for a background
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 22 May 2011 22:28:07 +0000 (22:28 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 22 May 2011 22:28:07 +0000 (22:28 +0000)
commitd9a62374f1de3cc3491ef3b30e07309634897cc2
tree3eac7778763f45ad26ae3f190c8ffbe63f59f79f
parent13f03f152f4f00af4efe7c929d379a3763724a6a
MFC r208489,r216208: sh: Reap any zombies before forking for a background
command.

This prevents accumulating huge amounts of zombies if a script executes
many background commands but no external commands or subshells.

Note that zombies will not be reaped during long calculations (within
the shell process) or read builtins, but those actions do not create
more zombies.

The terminated background commands will also still be remembered by the
shell.

r216208 fixes a bug in r208489 that could cause a multi-command pipeline to
be marked as done before all processes had been created.

PR: bin/55346

git-svn-id: svn://svn.freebsd.org/base/stable/8@222208 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
bin/sh/jobs.c