[vlc-commits] netsync: don't sleep on poll() EINTR

Rémi Denis-Courmont git at videolan.org
Sun Jan 23 16:49:22 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan 23 17:43:34 2011 +0200| [028174606c60efaeb6621d26bbf58192adc0a5d1] | committer: Rémi Denis-Courmont

netsync: don't sleep on poll() EINTR

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

 modules/control/netsync.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/modules/control/netsync.c b/modules/control/netsync.c
index e4f7106..6db3c34 100644
--- a/modules/control/netsync.c
+++ b/modules/control/netsync.c
@@ -180,7 +180,7 @@ static void *Master(void *handle)
         struct pollfd ufd = { .fd = sys->fd, .events = POLLIN, };
         uint64_t data[2];
 
-        if (poll(&ufd, 1, -1) <= 0)
+        if (poll(&ufd, 1, -1) < 0)
             continue;
 
         /* We received something */
@@ -232,11 +232,8 @@ static void *Slave(void *handle)
             goto wait;
 
         /* Don't block */
-        int ret = poll(&ufd, 1, sys->timeout);
-        if (ret == 0)
+        if (poll(&ufd, 1, sys->timeout) <= 0)
             continue;
-        if (ret < 0)
-            goto wait;
 
         const mtime_t receive_date = mdate();
         if (recv(sys->fd, data, sizeof(data), 0) <= 0)



More information about the vlc-commits mailing list