Fix waitpipe error handling in net_Accept()
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 18 Jan 2009 09:29:09 +0000 (11:29 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 18 Jan 2009 09:55:23 +0000 (11:55 +0200)
from fdb990bd55f690131f00a443f187577fc82c8aa6.
Spotted by Laurent.

src/network/tcp.c

index 4f9fa36..04ce2a4 100644 (file)
@@ -297,10 +297,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)