cedric pushed a commit to branch master.

commit 8d5e33077e9317fdd0ace25901457084413c5f54
Author: Cedric Bail <[email protected]>
Date:   Sun Mar 10 23:09:45 2013 +0900

    efl: use HAVE_FCNTL around call to fcntl.
---
 ChangeLog                                       | 1 +
 NEWS                                            | 1 +
 configure.ac                                    | 3 ++-
 src/lib/ecore_con/ecore_con_info.c              | 2 +-
 src/lib/ecore_file/ecore_file_monitor_inotify.c | 4 ++--
 src/lib/eina/eina_file.c                        | 4 ++--
 src/lib/eina/eina_mmap.c                        | 4 ++--
 src/lib/eio/eio_monitor_inotify.c               | 4 ++--
 src/lib/evas/canvas/evas_async_events.c         | 6 +++---
 src/lib/evas/cserve2/evas_cs2_client.c          | 4 ++--
 10 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 281ed38..48cef9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
 
diff --git a/NEWS b/NEWS
index 31b17ae..c79e0b0 100644
--- a/NEWS
+++ b/NEWS
@@ -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
diff --git a/configure.ac b/configure.ac
index 6aa0a65..78b429b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -468,7 +468,8 @@ malloc_usable_size \
 mkdirat \
 mtrace \
 realpath \
-strlcpy
+strlcpy \
+fcntl \
 ])
 
 AC_FUNC_ALLOCA
diff --git a/src/lib/ecore_con/ecore_con_info.c 
b/src/lib/ecore_con/ecore_con_info.c
index a4f8062..62a1836 100644
--- a/src/lib/ecore_con/ecore_con_info.c
+++ b/src/lib/ecore_con/ecore_con_info.c
@@ -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);
diff --git a/src/lib/ecore_file/ecore_file_monitor_inotify.c 
b/src/lib/ecore_file/ecore_file_monitor_inotify.c
index be35646..112bc81 100644
--- a/src/lib/ecore_file/ecore_file_monitor_inotify.c
+++ b/src/lib/ecore_file/ecore_file_monitor_inotify.c
@@ -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);
diff --git a/src/lib/eina/eina_file.c b/src/lib/eina/eina_file.c
index 271e4ce..126a665 100644
--- a/src/lib/eina/eina_file.c
+++ b/src/lib/eina/eina_file.c
@@ -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;
diff --git a/src/lib/eina/eina_mmap.c b/src/lib/eina/eina_mmap.c
index bed7e07..d8fd2e5 100644
--- a/src/lib/eina/eina_mmap.c
+++ b/src/lib/eina/eina_mmap.c
@@ -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);
diff --git a/src/lib/eio/eio_monitor_inotify.c 
b/src/lib/eio/eio_monitor_inotify.c
index bb2e091..012cd59 100644
--- a/src/lib/eio/eio_monitor_inotify.c
+++ b/src/lib/eio/eio_monitor_inotify.c
@@ -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);
diff --git a/src/lib/evas/canvas/evas_async_events.c 
b/src/lib/evas/canvas/evas_async_events.c
index ed8a551..2bab528 100644
--- a/src/lib/evas/canvas/evas_async_events.c
+++ b/src/lib/evas/canvas/evas_async_events.c
@@ -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;
diff --git a/src/lib/evas/cserve2/evas_cs2_client.c 
b/src/lib/evas/cserve2/evas_cs2_client.c
index 43bdd23..dcc8ff2 100644
--- a/src/lib/evas/cserve2/evas_cs2_client.c
+++ b/src/lib/evas/cserve2/evas_cs2_client.c
@@ -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);

-- 

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev

Reply via email to