Use getdtablesize() instead of OPEN_MAX.

Submitted by:	bde
This commit is contained in:
Dag-Erling Smørgrav 2001-06-13 11:55:40 +00:00
parent f41325db5f
commit 5333a1958c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=78162

View File

@ -223,7 +223,7 @@ fileGetURL(char *base, char *spec)
}
if (!tpid) {
dup2(pfd[0], 0);
for (fd = 3; fd < OPEN_MAX; ++fd)
for (fd = getdtablesize() - 1; fd >= 3; --fd)
close(fd);
execl("/usr/bin/tar", "tar", Verbose ? "-xzvf" : "-xzf", "-", 0);
_exit(2);