[Asterisk-cvs] zaptel ztdummy.c,1.14,1.15

kpfleming kpfleming
Sat Nov 5 13:39:50 CST 2005


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv16617

Modified Files:
	ztdummy.c 
Log Message:
don't fail the entire build process when HZ is not 1000, since the user may not be intending to use ztdummy anyway
if ztdummy is compiled with HZ != 1000, make the module load fail with an appropriate error message


Index: ztdummy.c
===================================================================
RCS file: /usr/cvsroot/zaptel/ztdummy.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- ztdummy.c	21 Oct 2005 19:05:23 -0000	1.14
+++ ztdummy.c	5 Nov 2005 18:31:10 -0000	1.15
@@ -100,7 +100,7 @@
 /* New 2.6 kernel timer stuff */
 static struct timer_list timer;
 #if HZ != 1000
-#error ztdummy requires 1000 hz jiffies
+#warning This module will not be usable since the kernel HZ setting is not 1000 ticks per second.
 #endif
 #endif
 #else
@@ -220,6 +220,13 @@
     }
 #endif
 
+#if defined(LINUX26) && !defined(USE_RTC)
+    if (HZ != 1000) {
+	    printk("ztdummy: This module requires the kernel HZ setting to be 1000 ticks per second\n");
+	    return -ENODEV;
+    }
+#endif /* defined(LINUX26) && !defined(USE_RTC) */
+
     ztd = kmalloc(sizeof(struct ztdummy), GFP_KERNEL);
     if (ztd == NULL) {
 	    printk("ztdummy: Unable to allocate memory\n");




More information about the svn-commits mailing list