[asterisk-commits] seanbright: trunk r240226 - /trunk/res/res_timing_timerfd.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 14 14:30:04 CST 2010


Author: seanbright
Date: Thu Jan 14 14:30:03 2010
New Revision: 240226

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=240226
Log:
If we aren't running on a machine that support CLOCK_MONOTONIC, don't load.

Group developed and tested by #asterisk-dev.

Modified:
    trunk/res/res_timing_timerfd.c

Modified: trunk/res/res_timing_timerfd.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_timing_timerfd.c?view=diff&rev=240226&r1=240225&r2=240226
==============================================================================
--- trunk/res/res_timing_timerfd.c (original)
+++ trunk/res/res_timing_timerfd.c Thu Jan 14 14:30:03 2010
@@ -262,6 +262,16 @@
 
 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;
 	}




More information about the asterisk-commits mailing list