thread_tools: minor simplification

This commit is contained in:
wm4 2018-05-17 21:03:02 +02:00
parent 31b78ad7fa
commit 094f6be600
1 changed files with 1 additions and 3 deletions

View File

@ -110,9 +110,7 @@ void mp_cancel_reset(struct mp_cancel *c)
// Flush it fully.
while (1) {
int r = read(c->wakeup_pipe[0], &(char[256]){0}, 256);
if (r < 0 && errno == EINTR)
continue;
if (r <= 0)
if (r <= 0 && !(r < 0 && errno == EINTR))
break;
}
}