[svn-commits] fjoe: freebsd/trunk r10688 - in /freebsd/trunk: drivers/dahdi/ include/linux/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed May 30 11:52:26 CDT 2012


Author: fjoe
Date: Wed May 30 11:52:22 2012
New Revision: 10688

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10688
Log:
- Really sleep in dahdi_ioctl_iomux()
- More correct implementation of wait_event_interruptible[_timeout]

Modified:
    freebsd/trunk/drivers/dahdi/dahdi-base.c
    freebsd/trunk/include/linux/wait.h

Modified: freebsd/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=10688&r1=10687&r2=10688
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi-base.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi-base.c Wed May 30 11:52:22 2012
@@ -214,6 +214,8 @@
 	init_waitqueue_head((wait_queue_head_t *) sel);
 }
 
+#define init_waitqueue_head(waitq)	dahdi_init_waitqueue_head(waitq)
+
 static void
 dahdi_wake_up_interruptible(struct selinfo *sel)
 {
@@ -265,18 +267,6 @@
 dahdi_poll_drain(wait_queue_head_t *waitq)
 {
 	// nothing to do
-}
-
-static void
-dahdi_init_waitqueue_head(wait_queue_head_t *waitq)
-{
-	init_waitqueue_head(waitq);
-}
-
-static void
-dahdi_wake_up_interruptible(wait_queue_head_t *waitq)
-{
-	wake_up_interruptible(waitq);
 }
 
 EXPORT_SYMBOL(dahdi_transcode_fops);
@@ -5774,7 +5764,9 @@
 		}
 
 #if defined(__FreeBSD__)
-		wait_event_interruptible(chan->waitq, 1);
+		ret = tsleep(&chan->waitq, PCATCH, "dahdimx", 0);
+		if (ret == ERESTART || ret == EINTR)
+			return -ERESTARTSYS;
 #else /* !__FreeBSD__ */
 		if (signal_pending(current)) {
 			finish_wait(&chan->waitq, &wait);

Modified: freebsd/trunk/include/linux/wait.h
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/include/linux/wait.h?view=diff&rev=10688&r1=10687&r2=10688
==============================================================================
--- freebsd/trunk/include/linux/wait.h (original)
+++ freebsd/trunk/include/linux/wait.h Wed May 30 11:52:22 2012
@@ -32,12 +32,12 @@
 	wakeup(q);
 }
 
-#define wait_event_timeout(q, condition, timeout)			\
+#define _wait_event(q, condition, prio, timeout)			\
 ({									\
-	int __ret = timeout;						\
+	int __ret = (timeout);						\
 	if (!(condition)) {						\
 		for (;;) {						\
-			if (tsleep(&q, 0, "wait_event", (timeout))) {	\
+			if (tsleep(&(q), (prio), "lxwait", (timeout))) { \
 				__ret = 0;				\
 				break;					\
 			}						\
@@ -47,7 +47,8 @@
 	}								\
 	__ret;								\
 })
-#define wait_event_interruptible(q, condition) wait_event_timeout(q, condition, 0)
-#define wait_event_interruptible_timeout(q, condition, timeout) wait_event_timeout(q, condition, timeout)
+#define wait_event_timeout(q, condition, timeout) _wait_event(q, condition, 0, timeout)
+#define wait_event_interruptible(q, condition) _wait_event(q, condition, PCATCH, 0)
+#define wait_event_interruptible_timeout(q, condition, timeout) _wait_event(q, condition, PCATCH, timeout)
 
 #endif /* _LINUX_WAIT_H_ */




More information about the svn-commits mailing list