]> Dogcows Code - chaz/tar/commit
tests: port to sh variants that squirrel away file descriptors
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 28 Oct 2010 03:25:18 +0000 (20:25 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 28 Oct 2010 03:25:56 +0000 (20:25 -0700)
commit3fe59ed5ef44d61d313e711b8920f8285792d3b2
tree29e99a90c120fa3e35dc423e3340f65dc3008e38
parent5af29cb944c84e2d539ce9df527d63c29f6012b9
tests: port to sh variants that squirrel away file descriptors

OpenBSD /bin/sh, and some other sh variants, squirrel away file
descriptors before closing them.  For example, for "cat 3<&-" they
first dup file descriptor 3 to a fd that is 10 or greater, then
close 3 (because if "cat" had been a builtin command like ":" then
they would have wanted to avoid the fork and restore the fd after
":" finished); and they treat ordinary (forking) commands the same
as builtin commands.  This approach fails after "ulimit -n 10".
Work around this deficiency by closing the file descriptors before
invoking ulimit.  Problem reported by Christian Weisgerber in
<http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00041.html>;
solution suggested by Jilles Tjoelker in
<http://article.gmane.org/gmane.comp.shells.dash/415>.

* tests/extrac11.at (scarce file descriptors): Close file
descriptors before invoking ulimit -n.
tests/extrac11.at
This page took 0.02411 seconds and 4 git commands to generate.