]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Bug #614 Add FOPEN_MAX as a parameter for dup_fd() usage. Also this is the fix for...
authorDanny Mayer <mayer@ntp.org>
Tue, 16 May 2006 11:58:39 +0000 (07:58 -0400)
committerDanny Mayer <mayer@ntp.org>
Tue, 16 May 2006 11:58:39 +0000 (07:58 -0400)
bk: 4469be6fN83BAmowwSzqQ4Grmx-3OQ

ntpd/ntp_io.c

index c95a7c925277202972c6dcd4708bf72df13943d1..d122555bd83786f7667b7821481665e100395055 100644 (file)
@@ -151,6 +151,9 @@ static      void    close_file      P((SOCKET));
 #endif
 #ifdef F_DUPFD
 static int     dup_fd          P((int));
+#ifndef FOPEN_MAX
+#define FOPEN_MAX      20
+#endif
 #endif
 
 static char *  fdbits          P((int, fd_set *));
@@ -252,8 +255,8 @@ static int dup_fd(int fd)
         /*
          * Leave a space for stdio to work in.
          */
-        if (fd >= 0 && fd < 20) {
-                newfd = fcntl(fd, F_DUPFD, 20);
+        if (fd >= 0 && fd < FOPEN_MAX) {
+                newfd = fcntl(fd, F_DUPFD, FOPEN_MAX);
 
                 tmp = errno;
                 if (newfd == -1)