forked from enlightenment/efl
Eina: In eina_file_open, only set the CLOEXEC flag if system supports exec
SVN revision: 63462
This commit is contained in:
parent
2495880ac0
commit
bfda6af5e5
|
@ -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=""
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue