From d3c30b356cd01fdaa77a7be4865678ceca80c368 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Fri, 11 Oct 2013 17:27:25 +0200 Subject: [PATCH] windows: Use _getmaxstdio as replacement for syscall(_SC_OPEN_MAX) --- src/libstrongswan/utils/utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libstrongswan/utils/utils.c b/src/libstrongswan/utils/utils.c index 63c5bd4bdd..03c7b4f7e3 100644 --- a/src/libstrongswan/utils/utils.c +++ b/src/libstrongswan/utils/utils.c @@ -418,7 +418,11 @@ void closefrom(int lowfd) } /* ...fall back to closing all fds otherwise */ +#ifdef WIN32 + maxfd = _getmaxstdio(); +#else maxfd = (int)sysconf(_SC_OPEN_MAX); +#endif if (maxfd < 0) { maxfd = 256; -- 2.47.3