summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2012-01-23 05:26:40 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2012-01-23 05:26:40 +0000
commite3d0fe06bd566b659a7c36b5d9892c6f6b9caa89 (patch)
treebf1a365c58c8bf0ae8a781e0960cac9c34aa2c2d /src
parent319f5003c66130fac091fa2f86070ea9f0a43cb8 (diff)
downloadopenrc-e3d0fe06bd566b659a7c36b5d9892c6f6b9caa89.tar.gz
openrc-e3d0fe06bd566b659a7c36b5d9892c6f6b9caa89.tar.bz2
openrc-e3d0fe06bd566b659a7c36b5d9892c6f6b9caa89.tar.xz
Respin features.h usage so that we correctly test for features before we use them. Some BSD libc implementations may have one or the other flag, but not both.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r--src/rc/checkpath.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index 4ad4ea7..0aee446 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -32,7 +32,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <features.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
@@ -68,8 +67,11 @@ do_check(char *path, uid_t uid, gid_t gid, mode_t mode, inode_t type, bool trunc
if (!mode) /* 664 */
mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH;
flags = O_CREAT|O_NDELAY|O_WRONLY|O_NOCTTY;
-#ifdef __USE_XOPEN2K8
- flags |= O_CLOEXEC|O_NOFOLLOW;
+#ifdef O_CLOEXEC
+ flags |= O_CLOEXEC;
+#endif
+#ifdef O_NOFOLLOW
+ flags |= O_NOFOLLOW;
#endif
if (trunc)
flags |= O_TRUNC;