Eina: In eina_file_open, only set the CLOEXEC flag if system supports exec

SVN revision: 63462
This commit is contained in:
Youness Alaoui 2011-09-18 21:57:10 +00:00
parent 2495880ac0
commit bfda6af5e5
2 changed files with 3 additions and 1 deletions

View 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=""

View 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;