Dave, Greg --

Here is a little patch for gserial.c to fix the timeout
while waiting for a condition (used to wait for data
to drain on close).  This patch applies to the gserial.c
file I sent Tuesday night.

I sent out a patch last night to add g_serial to
bk://kernel.bkbits.net/db/linux/gadget-2.4, but I
do not see it in mailing list messages...???  I
will send it again if it hasn't shown up by tonight.

-- Al

--- gserial.c.old       2003-10-02 09:56:49.000000000 -0500
+++ gserial.c   2003-10-02 10:07:36.000000000 -0500
@@ -97,17 +97,20 @@
 #define __wait_cond_interruptible_timeout(wq, condition, lock, flags,          \
                                                                                       
 timeout, ret)                                   \
 do {                                                                                  
                                                         \
+       signed long __timeout = timeout;                                               
                                 \
        wait_queue_t __wait;                                                           
                                         \
        init_waitqueue_entry(&__wait, current);                                        
                         \
                                                                                       
                                                                 \
        add_wait_queue(&wq, &__wait);                                                  
                                 \
        for (;;) {                                                                     
                                                         \
                set_current_state(TASK_INTERRUPTIBLE);                                 
                         \
+               if (__timeout == 0)                                                    
                                                 \
+                       break;                                                         
                                                         \
                if (condition)                                                         
                                                 \
                        break;                                                         
                                                         \
                if (!signal_pending(current)) {                                        
                                 \
                        spin_unlock_irqrestore(lock, flags);                           
                         \
-                       schedule_timeout(timeout);                                     
                                         \
+                       __timeout = schedule_timeout(__timeout);                       
                         \
                        spin_lock_irqsave(lock, flags);                                
                                 \
                        continue;                                                      
                                                         \
                }                                                                      
                                                                 \


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to