]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
added F_MAXFD
authorAlan T. DeKok <aland@freeradius.org>
Mon, 26 Sep 2016 12:10:07 +0000 (08:10 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 26 Sep 2016 12:10:07 +0000 (08:10 -0400)
src/lib/misc.c

index de2b50fa9716bb01fb3e4ba2872f55a935582cc7..f062ecf7861cb3597d128cb6ae451f47a72e2987 100644 (file)
@@ -1366,13 +1366,22 @@ int closefrom(int fd)
        }
 #endif
 
+#ifdef F_MAXFD
+       maxfd = fcntl(fd, F_F_MAXFD);
+       if (maxfd >= 0) goto do_close;
+#endif
+
 #ifdef _SC_OPEN_MAX
        maxfd = sysconf(_SC_OPEN_MAX);
        if (maxfd < 0) {
-         maxfd = 256;
+               maxfd = 256;
        }
 #endif
 
+#ifdef F_MAXFD
+do_close:
+#endif
+
        if (fd > maxfd) return 0;
 
        /*