]> git.sesse.net Git - vlc/blobdiff - src/network/tcp.c
Fix waitpipe error handling in net_Accept()
[vlc] / src / network / tcp.c
index 4f9fa36ad9aef186b708963ee219527342b1c25c..04ce2a4144283ea72aa4d85733dd10e7cc73d647 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)