]> git.sesse.net Git - vlc/commitdiff
netsync: don't sleep on poll() EINTR
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 23 Jan 2011 15:43:34 +0000 (17:43 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 23 Jan 2011 15:49:00 +0000 (17:49 +0200)
modules/control/netsync.c

index e4f7106b6cd373d91588ff23a4a26f50c4c775af..6db3c344d0109231ba9cdceadd59f6547c10bfc1 100644 (file)
@@ -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)