goo/gfile.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
New commits: commit 3d4db6773c46ac4f5df1bdb212a276db51f8d371 Author: Albert Astals Cid <[email protected]> Date: Fri Mar 4 20:03:04 2022 +0100 Move makeFileDescriptorCloexec inside the #if its used in diff --git a/goo/gfile.cc b/goo/gfile.cc index f0e68eee..327301df 100644 --- a/goo/gfile.cc +++ b/goo/gfile.cc @@ -147,21 +147,21 @@ GooString *appendToPath(GooString *path, const char *fileName) #endif } +#ifndef _WIN32 + static bool makeFileDescriptorCloexec(int fd) { -#ifdef FD_CLOEXEC +# ifdef FD_CLOEXEC int flags = fcntl(fd, F_GETFD); if (flags >= 0 && !(flags & FD_CLOEXEC)) flags = fcntl(fd, F_SETFD, flags | FD_CLOEXEC); return flags >= 0; -#else +# else return true; -#endif +# endif } -#ifndef _WIN32 - int openFileDescriptor(const char *path, int flags) { # ifdef O_CLOEXEC
