summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-05-17 14:45:12 +0000
committerShaun Ruffell <sruffell@digium.com>2010-05-17 14:45:12 +0000
commitbfc0b83fbd7e173e57c3b68ade6f6c87aee413e2 (patch)
tree279b3fe7442276cd3bc3c4c746edbaf45c475332
parent5bcd45ef20eb92c79c6dd6852052dd219067dc93 (diff)
dahdi: Check if wait_for_completion_timeout is backported.
CentOS4 has this backported in their 2.6.9 kernel. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8641 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/Kbuild4
-rw-r--r--include/dahdi/kernel.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/dahdi/Kbuild b/drivers/dahdi/Kbuild
index f0af285..3fe2e28 100644
--- a/drivers/dahdi/Kbuild
+++ b/drivers/dahdi/Kbuild
@@ -64,6 +64,10 @@ ifeq (1,$(shell fgrep -q ' hrtimer_set_expires' include/linux/hrtimer.h 2>/dev/n
EXTRA_CFLAGS+=-DHAVE_HRTIMER_ACCESSORS=1
endif
+ifeq (1,$(shell fgrep -q 'wait_for_completion_timeout' include/linux/completion.h 2>/dev/null && echo 1))
+CFLAGS_MODULE+=-DHAVE_WAIT_FOR_COMPLETION_TIMEOUT=1
+endif
+
# In 2.6.18 skb_linearize changed; however, some distros backported the change
ifneq (,$(wildcard $(srctree)/include/linux/skbuff.h))
ifeq ($(shell grep "skb_linearize.*(.*, .* gfp)" $(srctree)/include/linux/skbuff.h),)
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index 22fc3ee..ef71459 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -1209,6 +1209,7 @@ static inline void list_replace(struct list_head *old, struct list_head *new)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
#define synchronize_rcu() synchronize_kernel()
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11)
+#if !defined(HAVE_WAIT_FOR_COMPLETION_TIMEOUT)
static inline unsigned long
wait_for_completion_timeout(struct completion *x, unsigned long timeout)
{
@@ -1221,6 +1222,7 @@ wait_for_completion_timeout(struct completion *x, unsigned long timeout)
return timeout;
}
+#endif
#endif /* 2.6.11 */
#endif /* 2.6.12 */
#endif /* 2.6.14 */