forked from enlightenment/efl
ecore_file: use new API eina_file_close_on_exec.
This commit is contained in:
parent
662f7d3310
commit
214e22bf72
|
@ -53,19 +53,12 @@ int
|
||||||
ecore_file_monitor_backend_init(void)
|
ecore_file_monitor_backend_init(void)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
#ifdef HAVE_FCNTL
|
|
||||||
int flags;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fd = inotify_init();
|
fd = inotify_init();
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL
|
eina_file_close_on_exec(fd, EINA_TRUE);
|
||||||
flags = fcntl(fd, F_GETFD);
|
|
||||||
flags |= FD_CLOEXEC;
|
|
||||||
fcntl(fd, F_SETFD, flags);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_fdh = ecore_main_fd_handler_add(fd, ECORE_FD_READ, _ecore_file_monitor_inotify_handler,
|
_fdh = ecore_main_fd_handler_add(fd, ECORE_FD_READ, _ecore_file_monitor_inotify_handler,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
Loading…
Reference in New Issue