summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;