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
|
### Checks for library functions
|
||||||
AC_ISC_POSIX
|
AC_ISC_POSIX
|
||||||
AC_FUNC_ALLOCA
|
AC_FUNC_ALLOCA
|
||||||
AC_CHECK_FUNCS([strlcpy dirfd openat fstatat fpathconf])
|
AC_CHECK_FUNCS([strlcpy dirfd openat fstatat fpathconf execvp])
|
||||||
|
|
||||||
# dlopen and dladdr
|
# dlopen and dladdr
|
||||||
dlopen_libs=""
|
dlopen_libs=""
|
||||||
|
|
|
@ -769,6 +769,7 @@ eina_file_open(const char *filename, Eina_Bool shared)
|
||||||
|
|
||||||
if (fd < 0) return NULL;
|
if (fd < 0) return NULL;
|
||||||
|
|
||||||
|
#ifdef HAVE_EXECVP
|
||||||
flags = fcntl(fd, F_GETFD);
|
flags = fcntl(fd, F_GETFD);
|
||||||
if (flags == -1)
|
if (flags == -1)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
@ -776,6 +777,7 @@ eina_file_open(const char *filename, Eina_Bool shared)
|
||||||
flags |= FD_CLOEXEC;
|
flags |= FD_CLOEXEC;
|
||||||
if (fcntl(fd, F_SETFD, flags) == -1)
|
if (fcntl(fd, F_SETFD, flags) == -1)
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (fstat(fd, &file_stat))
|
if (fstat(fd, &file_stat))
|
||||||
goto on_error;
|
goto on_error;
|
||||||
|
|
Loading…
Reference in New Issue