aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-14 20:35:51 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-14 20:35:51 +0000
commit82ea2af7c9f1e04eb774941a9b48a9c1daa63535 (patch)
treebaffeb13f6a265d048ee771215e5f450de5cf3e2 /res
parent209a7b62ccde8b83c481b8d0f59f4d55c808f87c (diff)
Merged revisions 240226 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r240226 | seanbright | 2010-01-14 15:30:03 -0500 (Thu, 14 Jan 2010) | 4 lines If we aren't running on a machine that support CLOCK_MONOTONIC, don't load. Group developed and tested by seanbright, Corydon76, Kobaz, and Amorsen. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@240227 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_timing_timerfd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/res/res_timing_timerfd.c b/res/res_timing_timerfd.c
index b2ff89c75..a62453e4d 100644
--- a/res/res_timing_timerfd.c
+++ b/res/res_timing_timerfd.c
@@ -262,6 +262,16 @@ static unsigned int timerfd_timer_get_max_rate(int handle)
static int load_module(void)
{
+ int fd;
+
+ /* Make sure we support the necessary clock type */
+ if ((fd = timerfd_create(CLOCK_MONOTONIC, 0)) < 0) {
+ ast_log(LOG_ERROR, "CLOCK_MONOTONIC not supported. Not loading.\n");
+ return AST_MODULE_LOAD_DECLINE;
+ }
+
+ close(fd);
+
if (!(timerfd_timers = ao2_container_alloc(TIMERFD_TIMER_BUCKETS, timerfd_timer_hash, timerfd_timer_cmp))) {
return AST_MODULE_LOAD_DECLINE;
}