summaryrefslogtreecommitdiff
path: root/src/modules/clock
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-12-07 10:24:05 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-12-07 10:24:05 +0000
commit294c8951a4c7de4577dcdee18bb184a57766841a (patch)
tree4206d1be2ff602e7a5b9e9d6a01cf7894200a5d7 /src/modules/clock
parent96230bddd3cc0b8ce1c53c63af102a59ffdc000c (diff)
downloadenlightenment-294c8951a4c7de4577dcdee18bb184a57766841a.tar.gz
e: fix timerfd leak in E.
NOTE: I don't know why we do that here, look suspicious. NOTE2: fcntl(timer_fd, F_SETFL, O_NONBLOCK | FD_CLOEXEC) will not set the FD_CLOEXEC on linux, see the man page. SVN revision: 80428
Diffstat (limited to 'src/modules/clock')
-rw-r--r--src/modules/clock/e_mod_main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/clock/e_mod_main.c b/src/modules/clock/e_mod_main.c
index 1ac551c399..2140838cce 100644
--- a/src/modules/clock/e_mod_main.c
+++ b/src/modules/clock/e_mod_main.c
@@ -879,11 +879,17 @@ e_modapi_init(E_Module *m)
#ifdef HAVE_SYS_TIMERFD_H
int timer_fd;
+ int flags;
/* on old systems, flags must be 0, so we'll play nice and do it always */
timer_fd = timerfd_create(CLOCK_REALTIME, 0);
if (timer_fd < 0) return m;
- fcntl(timer_fd, F_SETFL, O_NONBLOCK | FD_CLOEXEC);
+ fcntl(timer_fd, F_SETFL, O_NONBLOCK);
+
+ flags = fcntl(timer_fd, F_GETFD);
+ flags |= FD_CLOEXEC;
+ fcntl(timer_fd, F_SETFD, flags);
+
timerfd_handler = ecore_main_fd_handler_add(timer_fd, ECORE_FD_READ, _clock_fd_update, NULL, NULL, NULL);
#endif
return m;