From 69d2414cb9a3bbbacd2556c4a7e941600f621343 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Fri, 6 Sep 2019 22:39:29 +0200 Subject: [PATCH] Fix blocking write for FIFO --- src/util/fifo.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util/fifo.h b/src/util/fifo.h index 3ffd03e7663..1355430ddd7 100644 --- a/src/util/fifo.h +++ b/src/util/fifo.h @@ -43,10 +43,8 @@ class FIFO { } void writeBlocking(const DataType* pData, int count) { int written = 0; - while (written != count) { - int i = write(pData, count); - pData += i; - written += i; + while (written < count) { + written += write(pData + written, count - written); } } int aquireWriteRegions(int count,