summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-closefrom.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2006-08-17 19:35:49 +1000
committerDarren Tucker <dtucker@zip.com.au>2006-08-17 19:35:49 +1000
commit3083bc2b52fe00b5c5fe87dd3638969835dab0e8 (patch)
tree0ffdaf950cd854baca3e1fb54a63ee3f61fc871d /openbsd-compat/bsd-closefrom.c
parente6b641a9a13d664fb7b98227218a0b3f65dfd40c (diff)
- (dtucker) [configure.ac openbsd-compat/bsd-closefrom.c] Use F_CLOSEM fcntl
for closefrom() on AIX. Pointed out by William Ahern.
Diffstat (limited to 'openbsd-compat/bsd-closefrom.c')
-rw-r--r--openbsd-compat/bsd-closefrom.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-closefrom.c b/openbsd-compat/bsd-closefrom.c
index 3f17302d..e7a521e4 100644
--- a/openbsd-compat/bsd-closefrom.c
+++ b/openbsd-compat/bsd-closefrom.c
@@ -22,6 +22,9 @@
#include <sys/param.h>
#include <unistd.h>
#include <stdio.h>
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
#include <limits.h>
#include <stdlib.h>
#include <stddef.h>
@@ -76,6 +79,10 @@ closefrom(int lowfd)
}
(void) closedir(dirp);
} else
+#elif defined(USE_FCNTL_CLOSEM)
+ if (fcntl(lowfd, F_CLOSEM, 0) != -1) {
+ return;
+ } else
#endif
{
/*