From 291ee9f86a172ab27cf4e95209a8dd1a2921c4ca Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 6 Aug 2015 10:13:21 +0200 Subject: output/fifo: simplify the Cancel() loop --- src/output/plugins/FifoOutputPlugin.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/output') diff --git a/src/output/plugins/FifoOutputPlugin.cxx b/src/output/plugins/FifoOutputPlugin.cxx index d425ce85d..aa2b74bc2 100644 --- a/src/output/plugins/FifoOutputPlugin.cxx +++ b/src/output/plugins/FifoOutputPlugin.cxx @@ -227,12 +227,13 @@ inline void FifoOutput::Cancel() { char buf[FIFO_BUFFER_SIZE]; - int bytes = 1; + int bytes; timer->Reset(); - while (bytes > 0 && errno != EINTR) + do { bytes = read(input, buf, FIFO_BUFFER_SIZE); + } while (bytes > 0 && errno != EINTR); if (bytes < 0 && errno != EAGAIN) { FormatErrno(fifo_output_domain, -- cgit v1.2.3