summaryrefslogtreecommitdiff
path: root/include/dahdi
diff options
context:
space:
mode:
authorRuss Meyerriecks <rmeyerreicks@digium.com>2010-08-06 20:10:23 +0000
committerRuss Meyerriecks <rmeyerreicks@digium.com>2010-08-06 20:10:23 +0000
commitdf260bb8c4bc2d4ad17248a2340fe36855f8e993 (patch)
tree95021ebef629eb3db0f8f86c6e9424cbf6b374f1 /include/dahdi
parent20c224760ef8b8aa895597dbed48a2eac3759bd1 (diff)
dahdi: Backport strcasecmp for kernels < 2.6.22
strcasecmp was brought into the kernel at v2.6.22 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9097 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'include/dahdi')
-rw-r--r--include/dahdi/kernel.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index a33ca18..721ad57 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -1198,10 +1198,22 @@ static inline short dahdi_txtone_nextsample(struct dahdi_chan *ss)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
/* Some distributions backported fatal_signal_pending so we'll use a macro to
- * override the inline functino definition. */
+ * override the inline function definition. */
#define fatal_signal_pending(p) \
(signal_pending((p)) && sigismember(&(p)->pending.signal, SIGKILL))
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)
+#include <linux/ctype.h>
+static inline int strcasecmp(const char *s1, const char *s2)
+{
+ int c1, c2;
+
+ do {
+ c1 = tolower(*s1++);
+ c2 = tolower(*s2++);
+ } while (c1 == c2 && c1 != 0);
+ return c1 - c2;
+}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
static inline void list_replace(struct list_head *old, struct list_head *new)
{
@@ -1233,6 +1245,7 @@ wait_for_completion_timeout(struct completion *x, unsigned long timeout)
#endif /* 2.6.12 */
#endif /* 2.6.14 */
#endif /* 2.6.18 */
+#endif /* 2.6.22 */
#endif /* 2.6.25 */
#endif /* 2.6.26 */
#endif /* 2.6.31 */