eio: use new API eina_file_close_on_exec.
authorCedric BAIL <cedric@osg.samsung.com>
Tue, 18 Apr 2017 23:56:40 +0000 (16:56 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Tue, 18 Apr 2017 23:56:40 +0000 (16:56 -0700)
src/lib/eio/eio_monitor_inotify.c

index 92795165c1cfacc08fd9999d6a8d8083247d0b09..4f36778f5fc42176e128b911ec824849eaa008b7 100644 (file)
@@ -182,13 +182,7 @@ void eio_monitor_backend_init(void)
    if (fd < 0)
      return;
 
-#ifdef HAVE_FCNTL
-   flags = fcntl(fd, F_GETFD);
-   flags |= FD_CLOEXEC;
-   rc = fcntl(fd, F_SETFD, flags);
-   if (rc < 0)
-     return;
-#endif
+   eina_file_close_on_exec(fd, EINA_TRUE);
 
    _inotify_fdh = ecore_main_fd_handler_add(fd, ECORE_FD_READ, _eio_inotify_handler, NULL, NULL, NULL);
    if (!_inotify_fdh)