vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Sat May 9 22:41:23 2015 +0300| [7d28f8a24c75fd5ffcd393f047208a0d7f55a187] | committer: Rémi Denis-Courmont
network: remove useless vlc_object_waitpipe() call in net_Accept() None of the call sites use the input thread and wait pipe. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7d28f8a24c75fd5ffcd393f047208a0d7f55a187 --- src/network/tcp.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/network/tcp.c b/src/network/tcp.c index 98bb3fd..f999aaf 100644 --- a/src/network/tcp.c +++ b/src/network/tcp.c @@ -270,26 +270,23 @@ int net_AcceptSingle (vlc_object_t *obj, int lfd) */ int net_Accept (vlc_object_t *p_this, int *pi_fd) { - int evfd = vlc_object_waitpipe (p_this); - assert (pi_fd != NULL); unsigned n = 0; while (pi_fd[n] != -1) n++; - struct pollfd ufd[n + 1]; + struct pollfd ufd[n]; /* Initialize file descriptor set */ - for (unsigned i = 0; i <= n; i++) + for (unsigned i = 0; i < n; i++) { - ufd[i].fd = (i < n) ? pi_fd[i] : evfd; + ufd[i].fd = pi_fd[i]; ufd[i].events = POLLIN; } - ufd[n].revents = 0; for (;;) { - while (poll (ufd, n + (evfd != -1), -1) == -1) + while (poll (ufd, n, -1) == -1) { if (net_errno != EINTR) { @@ -316,12 +313,6 @@ int net_Accept (vlc_object_t *p_this, int *pi_fd) pi_fd[n - 1] = sfd; return fd; } - - if (ufd[n].revents) - { - errno = EINTR; - break; - } } return -1; } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
