[vlc-devel] commit: Fix waitpipe error handling in net_Accept() ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Jan 18 11:06:44 CET 2009


vlc | branch: 0.9-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Jan 18 11:29:09 2009 +0200| [59b9e48b634ca898d632189cf34483d4ec7bd896] | committer: Rémi Denis-Courmont 

Fix waitpipe error handling in net_Accept()

from fdb990bd55f690131f00a443f187577fc82c8aa6.
Spotted by Laurent.
(cherry picked from commit a969b13d873762a1323d98361fd37accbd7247a1)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=59b9e48b634ca898d632189cf34483d4ec7bd896
---

 src/network/tcp.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/network/tcp.c b/src/network/tcp.c
index 796421b..3ef84ab 100644
--- a/src/network/tcp.c
+++ b/src/network/tcp.c
@@ -298,10 +298,8 @@ int __net_Accept( vlc_object_t *p_this, int *pi_fd, mtime_t i_wait )
             ufd[i].events = POLLIN;
             ufd[i].revents = 0;
         }
-        if (evfd == -1)
-            n--; /* avoid EBADF */
 
-        switch (poll (ufd, n, timeout))
+        switch (poll (ufd, n + (evfd != -1), timeout))
         {
             case -1:
                 if (net_errno == EINTR)




More information about the vlc-devel mailing list