output/fifo: simplify the Cancel() loop

This commit is contained in:
Max Kellermann 2015-08-06 10:13:21 +02:00
parent 59e4d7f0f5
commit 291ee9f86a

View File

@ -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,