aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/utils/utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstrongswan/utils/utils.c b/src/libstrongswan/utils/utils.c
index 63c5bd4bd..03c7b4f7e 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;