From 094f6be60041c67359a29dec905e66129b538afa Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 17 May 2018 21:03:02 +0200 Subject: thread_tools: minor simplification --- misc/thread_tools.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'misc') 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; } } -- cgit v1.2.3