linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] avoid OPEN_MAX in SCM_MAX_FD
@ 2007-03-13  8:39 Roland McGrath
  2007-03-13 14:17 ` Benjamin LaHaise
  0 siblings, 1 reply; 8+ messages in thread
From: Roland McGrath @ 2007-03-13  8:39 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel

The OPEN_MAX constant is an arbitrary number with no useful relation to
anything.  Nothing should be using it.  This patch changes SCM_MAX_FD to
use NR_OPEN instead of OPEN_MAX.  This increases the size of the struct
scm_fp_list type fourfold, to make it big enough to contain as many file
descriptors as could be asked of it.  This size increase may not be very
worthwhile, but at any rate if an arbitrary limit unrelated to anything
else is being defined it should be done explicitly here with:

	#define SCM_MAX_FD	255

Using the OPEN_MAX constant here is just confusing and misleading.

Signed-off-by: Roland McGrath <roland@redhat.com>
---
 include/net/scm.h |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/net/scm.h b/include/net/scm.h
index 5637d5e..4d37c5e 100644  
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -8,7 +8,7 @@
 /* Well, we should have at least one descriptor open
  * to accept passed FDs 8)
  */
-#define SCM_MAX_FD	(OPEN_MAX-1)
+#define SCM_MAX_FD	(NR_OPEN-1)
 
 struct scm_fp_list
 {

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-03-14 19:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-13  8:39 [PATCH 1/2] avoid OPEN_MAX in SCM_MAX_FD Roland McGrath
2007-03-13 14:17 ` Benjamin LaHaise
2007-03-13 20:02   ` Roland McGrath
2007-03-13 21:28     ` Linus Torvalds
2007-03-14  0:55       ` Roland McGrath
2007-03-14  1:15         ` Linus Torvalds
2007-03-14  9:45           ` Jochen Voß
2007-03-14 19:52           ` Olaf Kirch

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).