netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] do not rely on OPEN_MAX
@ 2007-10-15  5:50 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2007-10-15  5:50 UTC (permalink / raw)
  To: yoshfuji; +Cc: netdev


[-- Attachment #1.1: Type: text/plain, Size: 172 bytes --]

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

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

[-- Attachment #2: iputils-20070202-no-open-max.patch --]
[-- Type: text/x-diff, Size: 367 bytes --]

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

--- a/rdisc.c
+++ b/rdisc.c
@@ -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);
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-10-15  5:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-15  5:50 [patch] do not rely on OPEN_MAX Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).