Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37570727
en ru br
ALT Linux repos
S:20221126-alt1
5.0: 20071127-alt4
4.1: 20071127-alt0.M41.1
4.0: 20020927-alt4.2
3.0: 20020927-alt2

Group :: Networking/Other
RPM: iputils

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: iputils-20070202-fc-open-max.patch
Download


diff -up iputils-s20071127/rdisc.c.open_max iputils-s20071127/rdisc.c
--- iputils-s20071127/rdisc.c.open_max	2008-02-25 11:15:37.000000000 +0100
+++ iputils-s20071127/rdisc.c	2008-02-25 11:17:30.000000000 +0100
@@ -240,14 +240,25 @@ void do_fork(void)
 {
 	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);
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin