Eina: In eina_file_open, only set the CLOEXEC flag if system supports exec
authorkakaroto <kakaroto@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 18 Sep 2011 21:57:10 +0000 (21:57 +0000)
committerkakaroto <kakaroto@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 18 Sep 2011 21:57:10 +0000 (21:57 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@63462 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
src/lib/eina_file.c

index 054c0e9..2401b71 100644 (file)
@@ -459,7 +459,7 @@ EFL_LINKER_FLAG([-fno-strict-aliasing])
 ### Checks for library functions
 AC_ISC_POSIX
 AC_FUNC_ALLOCA
-AC_CHECK_FUNCS([strlcpy dirfd openat fstatat fpathconf])
+AC_CHECK_FUNCS([strlcpy dirfd openat fstatat fpathconf execvp])
 
 # dlopen and dladdr
 dlopen_libs=""
index dde64f4..92d6215 100644 (file)
@@ -769,6 +769,7 @@ eina_file_open(const char *filename, Eina_Bool shared)
 
    if (fd < 0) return NULL;
 
+#ifdef HAVE_EXECVP
    flags = fcntl(fd, F_GETFD);
    if (flags == -1)
      goto on_error;
@@ -776,6 +777,7 @@ eina_file_open(const char *filename, Eina_Bool shared)
    flags |= FD_CLOEXEC;
    if (fcntl(fd, F_SETFD, flags) == -1)
      goto on_error;
+#endif
 
    if (fstat(fd, &file_stat))
      goto on_error;