From 53612664740f3a31d93d2059f7d981da3ba565dc Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 29 Jul 2017 18:23:01 -0400 Subject: util: Define O_DIRECTORY to 0 if it's not already defined --- exec.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'exec.c') diff --git a/exec.c b/exec.c index 342775c..1884536 100644 --- a/exec.c +++ b/exec.c @@ -306,11 +306,7 @@ static int bfs_exec_openwd(struct bfs_exec *execbuf, const struct BFTW *ftwbuf) } if (execbuf->wd_fd < 0) { - int flags = O_RDONLY | O_CLOEXEC; -#ifdef O_DIRECTORY - flags |= O_DIRECTORY; -#endif - execbuf->wd_fd = open(execbuf->wd_path, flags); + execbuf->wd_fd = open(execbuf->wd_path, O_RDONLY | O_CLOEXEC | O_DIRECTORY); } if (execbuf->wd_fd < 0) { -- cgit v1.2.3