summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/pkg_install/lib/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c
index 42602ec81ebf..d1e410079ee3 100644
--- a/usr.sbin/pkg_install/lib/file.c
+++ b/usr.sbin/pkg_install/lib/file.c
@@ -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);