diff options
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/bsd-closefrom.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c index 3f17302d1..e7a521e43 100644 --- a/openbsd-compat/bsd-closefrom.c +++ b/openbsd-compat/bsd-closefrom.c | |||
@@ -22,6 +22,9 @@ | |||
22 | #include <sys/param.h> | 22 | #include <sys/param.h> |
23 | #include <unistd.h> | 23 | #include <unistd.h> |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #ifdef HAVE_FCNTL_H | ||
26 | # include <fcntl.h> | ||
27 | #endif | ||
25 | #include <limits.h> | 28 | #include <limits.h> |
26 | #include <stdlib.h> | 29 | #include <stdlib.h> |
27 | #include <stddef.h> | 30 | #include <stddef.h> |
@@ -76,6 +79,10 @@ closefrom(int lowfd) | |||
76 | } | 79 | } |
77 | (void) closedir(dirp); | 80 | (void) closedir(dirp); |
78 | } else | 81 | } else |
82 | #elif defined(USE_FCNTL_CLOSEM) | ||
83 | if (fcntl(lowfd, F_CLOSEM, 0) != -1) { | ||
84 | return; | ||
85 | } else | ||
79 | #endif | 86 | #endif |
80 | { | 87 | { |
81 | /* | 88 | /* |