summaryrefslogtreecommitdiffstats
path: root/misc/thread_tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/thread_tools.c')
-rw-r--r--misc/thread_tools.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/misc/thread_tools.c b/misc/thread_tools.c
index 57a4900ad6..b11ffd07e4 100644
--- a/misc/thread_tools.c
+++ b/misc/thread_tools.c
@@ -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;
}
}