]> Dogcows Code - chaz/tar/commitdiff
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)
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.


No differences found
This page took 0.025557 seconds and 4 git commands to generate.