diff options
-rw-r--r-- | mk/os-Linux.mk | 2 | ||||
-rw-r--r-- | src/rc/checkpath.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/mk/os-Linux.mk b/mk/os-Linux.mk index bdd12031..40d9c342 100644 --- a/mk/os-Linux.mk +++ b/mk/os-Linux.mk @@ -4,5 +4,5 @@ SFX= .Linux.in PKG_PREFIX?= /usr -CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=600 +CPPFLAGS+= -D_BSD_SOURCE -D_XOPEN_SOURCE=700 LIBDL= -Wl,-Bdynamic -ldl diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c index 4ad4ea7d..0aee4465 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; |