summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2000-08-08 14:57:02 +0000
committerClint Adams <clint@users.sourceforge.net>2000-08-08 14:57:02 +0000
commitcb89544d32619822541153118b0bc9c936573c64 (patch)
treedbab588ad5cff4f9e801a9b9804e0dfc12a2bac5 /Src/exec.c
parent3bca186819e7e1e0fc6321592ccc62d75e0525be (diff)
downloadzsh-cb89544d32619822541153118b0bc9c936573c64.tar.gz
zsh-cb89544d32619822541153118b0bc9c936573c64.tar.xz
zsh-cb89544d32619822541153118b0bc9c936573c64.zip
12568: check sysconf(_SC_OPEN_MAX) if available instead of OPEN_MAX/NOFILES.
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index cec096d25..698591475 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1404,8 +1404,11 @@ static void
 closeallelse(struct multio *mn)
 {
     int i, j;
+    long openmax;
 
-    for (i = 0; i < OPEN_MAX; i++)
+    openmax = zopenmax();
+
+    for (i = 0; i < openmax; i++)
 	if (mn->pipe != i) {
 	    for (j = 0; j < mn->ct; j++)
 		if (mn->fds[j] == i)