Skip to contentSkip to conversation

do not rely on OPEN_MAX

PATCH New Mike Frysinger 1 participant 1 message Oct 15, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 do not rely on OPEN_MAX

the OPEN_MAX define was removed from the kernel's limits.h during the 2.6.23 development cycle, so switching to using the dynamic sysconf() func should be done
-mike

the OPEN_MAX define has been removed in newer kernel headers so use the proper method of getting the value dynamically

http://bugs.gentoo.org/195861

rdisc.c +1 -1
@@ -247,7 +247,7 @@ void do_fork(void)
 	if ((pid=fork()) != 0)
 		exit(0);
 
-	for (t = 0; t < OPEN_MAX; t++)
+	for (t = 0; t < sysconf(_SC_OPEN_MAX); t++)
 		if (t != s)
 			close(t);