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

Rémi Denis-Courmont git at videolan.org
Sun Jan 23 17:02:35 CET 2011


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

netsync: don't sleep on poll() EINTR

(cherry picked from commit 028174606c60efaeb6621d26bbf58192adc0a5d1)

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

 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 455be18..3a6f77b 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