Commit c2b8728e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

netsync: don't sleep on poll() EINTR

(cherry picked from commit 028174606c60efaeb6621d26bbf58192adc0a5d1)
parent 17795d9f
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment