bin/113860: sh(1): shell is still running when using `sh -c'

Jilles Tjoelker jilles at stack.nl
Sun Apr 12 14:33:36 PDT 2009


On Fri, Apr 03, 2009 at 11:39:05PM +0200, Jilles Tjoelker wrote:
> I think this can be improved.

I have a patch now; it does not handle all cases but the effect on the
code is minimal. I decided to go with the readahead but only do it for
the first line.

To avoid problems with traps not being executed,
http://www.stack.nl/~jilles/unix/sh-forkiftrapped.patch is needed. This
fixes a bug in EV_EXIT handling, which would be triggered more often
with the change to -c. The patch is also needed for bin/74404.
Example: sh -c '(trap "echo trapped" EXIT; sleep 3)'

http://www.stack.nl/~jilles/unix/sh-minusc-exec.patch the change itself

-- 
Jilles Tjoelker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sh-forkiftrapped.patch
Type: text/x-diff
Size: 1371 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20090412/26cf81be/sh-forkiftrapped.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sh-minusc-exec.patch
Type: text/x-diff
Size: 2310 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20090412/26cf81be/sh-minusc-exec.bin


More information about the freebsd-hackers mailing list