efl: use HAVE_FCNTL around call to fcntl.

This commit is contained in:
Cedric Bail 2013-03-10 23:09:45 +09:00
parent aac1bbb017
commit 8d5e33077e
10 changed files with 18 additions and 15 deletions

View File

@ -3,6 +3,7 @@
* Eeze: add a dummy implementation of libmount when it is not available.
* Ecore_Con: add systemd socket activation support (ECORE_CON_SOCKET_ACTIVATE).
* Ecore: notify systemd that we are ready as soon as the main loop is running.
* EFL: use HAVE_FCNTL to disable code using fcntl.
2013-03-08 Igor Murzov

1
NEWS
View File

@ -122,6 +122,7 @@ Improvements:
* Evas GL engine downscale quality in smooth mode much improved with multisampling up to effectively 16x16 via shaders.
* eina: eina_strlcat now work with a NULL source.
* Evas textblock: Added proper size adjustments for "high" shaped texts.
* Use the right macro to disable fcntl.
Fixes:
* Fix a memory leak in ecore_con_dns when using ecore_con_server_connect

View File

@ -468,7 +468,8 @@ malloc_usable_size \
mkdirat \
mtrace \
realpath \
strlcpy
strlcpy \
fcntl \
])
AC_FUNC_ALLOCA

View File

@ -180,7 +180,7 @@ ecore_con_info_mcast_listen(Ecore_Con_Server *svr,
Eina_Bool
_ecore_fd_close_on_exec(int fd)
{
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
int flags;
flags = fcntl(fd, F_GETFD);

View File

@ -50,7 +50,7 @@ int
ecore_file_monitor_backend_init(void)
{
int fd;
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
int flags;
#endif
@ -58,7 +58,7 @@ ecore_file_monitor_backend_init(void)
if (fd < 0)
return 0;
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
flags = fcntl(fd, F_GETFD);
flags |= FD_CLOEXEC;
fcntl(fd, F_SETFD, flags);

View File

@ -957,7 +957,7 @@ eina_file_open(const char *path, Eina_Bool shared)
char *filename;
struct stat file_stat;
int fd = -1;
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
int flags;
#endif
@ -977,7 +977,7 @@ eina_file_open(const char *path, Eina_Bool shared)
if (fd < 0) goto on_error;
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
flags = fcntl(fd, F_GETFD);
if (flags == -1)
goto on_error;

View File

@ -156,7 +156,7 @@ eina_mmap_safety_enabled_set(Eina_Bool enabled)
/* no zero page device - open it */
if (_eina_mmap_zero_fd < 0)
{
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
int flags;
#endif
@ -164,7 +164,7 @@ eina_mmap_safety_enabled_set(Eina_Bool enabled)
/* if we don;'t have one - fail to set up mmap safety */
if (_eina_mmap_zero_fd < 0) return EINA_FALSE;
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
flags = fcntl(_eina_mmap_zero_fd, F_GETFD);
flags |= FD_CLOEXEC;
fcntl(_eina_mmap_zero_fd, F_SETFD, flags);

View File

@ -164,7 +164,7 @@ _eio_inotify_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh)
void eio_monitor_backend_init(void)
{
int fd;
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
int flags;
#endif
@ -172,7 +172,7 @@ void eio_monitor_backend_init(void)
if (fd < 0)
return ;
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
flags = fcntl(fd, F_GETFD);
flags |= FD_CLOEXEC;
fcntl(fd, F_SETFD, flags);

View File

@ -35,7 +35,7 @@ static int _init_evas_event = 0;
Eina_Bool
_evas_fd_close_on_exec(int fd)
{
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
int flags;
flags = fcntl(fd, F_GETFD);
@ -74,7 +74,7 @@ evas_async_events_init(void)
_fd_read = filedes[0];
_fd_write = filedes[1];
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
fcntl(_fd_read, F_SETFL, O_NONBLOCK);
#endif
@ -195,7 +195,7 @@ evas_async_events_process(void)
static void
_evas_async_events_fd_blocking_set(Eina_Bool blocking)
{
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
long flags = fcntl(_fd_read, F_GETFL);
if (blocking) flags &= ~O_NONBLOCK;

View File

@ -87,7 +87,7 @@ _server_connect(void)
{
int s, len;
struct sockaddr_un remote;
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
int flags;
#endif
@ -97,7 +97,7 @@ _server_connect(void)
return EINA_FALSE;
}
#ifdef HAVE_EXECVP
#ifdef HAVE_FCNTL
flags = fcntl(s, F_GETFD);
flags |= FD_CLOEXEC;
fcntl(s, F_SETFD, flags);