]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 240226 via svnmerge from
authorSean Bright <sean@malleable.com>
Thu, 14 Jan 2010 20:35:51 +0000 (20:35 +0000)
committerSean Bright <sean@malleable.com>
Thu, 14 Jan 2010 20:35:51 +0000 (20:35 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@240227 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_timing_timerfd.c

index b2ff89c75e424886e48ac720aff4f4797e5340e0..a62453e4d72e09bc1482f3e807fec04dbd7eeb11 100644 (file)
@@ -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;
        }