mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 11:32:25 +00:00
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/trunk@240226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user