diff --git a/src/webfuse/util/authenticator.cpp b/src/webfuse/util/authenticator.cpp index 579aaab..990aab9 100644 --- a/src/webfuse/util/authenticator.cpp +++ b/src/webfuse/util/authenticator.cpp @@ -4,6 +4,22 @@ #include #include +#ifndef closefrom +namespace +{ + +void closefrom(int fd) +{ + int const max_fd = sysconf(_SC_OPEN_MAX); + for(int i = fd; i < max_fd; i++) + { + close(i); + } +} + +} +#endif + namespace webfuse { diff --git a/test-src/integration/webfuse/test/process.cpp b/test-src/integration/webfuse/test/process.cpp index 2866565..86e657e 100644 --- a/test-src/integration/webfuse/test/process.cpp +++ b/test-src/integration/webfuse/test/process.cpp @@ -9,6 +9,23 @@ #include +#ifndef closefrom +namespace +{ + +void closefrom(int fd) +{ + int const max_fd = sysconf(_SC_OPEN_MAX); + for(int i = fd; i < max_fd; i++) + { + close(i); + } +} + +} +#endif + + namespace webfuse {