summary refs log tree commit diff
path: root/pkgs/os-specific/linux/iputils/open-max.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/iputils/open-max.patch')
-rw-r--r--pkgs/os-specific/linux/iputils/open-max.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/iputils/open-max.patch b/pkgs/os-specific/linux/iputils/open-max.patch
new file mode 100644
index 00000000000..26bb95bd9d8
--- /dev/null
+++ b/pkgs/os-specific/linux/iputils/open-max.patch
@@ -0,0 +1,30 @@
+--- iputils-s20070202/rdisc.c.open-max	2007-08-07 11:34:03.000000000 +0200
++++ iputils-s20070202/rdisc.c	2007-08-07 11:41:30.000000000 +0200
+@@ -240,14 +240,25 @@
+ {
+ 	int t;
+ 	pid_t pid;
+-	
++	long open_max;
++
+ 	if (trace)
+ 		return;
+ 
++	if ((open_max = sysconf(_SC_OPEN_MAX)) == -1) {
++		if (errno == 0) {
++			(void) fprintf(stderr, "OPEN_MAX is not supported\n");
++		}
++		else {
++			(void) fprintf(stderr, "sysconf() error\n");
++		}
++		exit(1);
++	}
++
+ 	if ((pid=fork()) != 0)
+ 		exit(0);
+ 
+-	for (t = 0; t < OPEN_MAX; t++)
++	for (t = 0; t < open_max; t++)
+ 		if (t != s)
+ 			close(t);
+