commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 02/70: Fix polling pfinet tun for write


From: Samuel Thibault
Subject: [hurd] 02/70: Fix polling pfinet tun for write
Date: Mon, 16 Sep 2013 07:41:34 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 25a628b3403249499ba3f87ab177c441c8f432ee
Author: Samuel Thibault <address@hidden>
Date:   Fri Aug 23 15:51:37 2013 +0200

    Fix polling pfinet tun for write
    
    * pfinet/tunnel.c (io_select_common): Also handle `SELECT_WRITE' case.
---
 pfinet/tunnel.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/pfinet/tunnel.c b/pfinet/tunnel.c
index 4a6f616..495356c 100644
--- a/pfinet/tunnel.c
+++ b/pfinet/tunnel.c
@@ -479,14 +479,23 @@ io_select_common (struct trivfs_protid *cred,
 
   tdev = (struct tunnel_device *) cred->po->cntl->hook;
 
-  /* We only deal with SELECT_READ here.  */
-  *type &= SELECT_READ;
+  /* We only deal with SELECT_READ and SELECT_WRITE here.  */
+  *type &= SELECT_READ | SELECT_WRITE;
 
   if (*type == 0)
     return 0;
 
   pthread_mutex_lock (&tdev->lock);
 
+  if (*type & SELECT_WRITE)
+    {
+      /* We are always writable.  */
+      if (skb_queue_len (&tdev->xq) == 0)
+       *type &= ~SELECT_READ;
+      pthread_mutex_unlock (&tdev->lock);
+      return 0;
+    }
+
   while (1)
     {
       if (skb_queue_len (&tdev->xq) != 0)

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]