diff options
author | Max Kellermann <max@duempel.org> | 2015-08-06 10:13:21 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-08-06 10:13:21 +0200 |
commit | 291ee9f86a172ab27cf4e95209a8dd1a2921c4ca (patch) | |
tree | 22ec0f1027f81513cac6d302882619954aff004c | |
parent | 59e4d7f0f5daaa120c6eccededd8aa687c56d739 (diff) | |
download | mpd-291ee9f86a172ab27cf4e95209a8dd1a2921c4ca.tar.gz mpd-291ee9f86a172ab27cf4e95209a8dd1a2921c4ca.tar.xz mpd-291ee9f86a172ab27cf4e95209a8dd1a2921c4ca.zip |
output/fifo: simplify the Cancel() loop
Diffstat (limited to '')
-rw-r--r-- | src/output/plugins/FifoOutputPlugin.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
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, |