[SeaBIOS] [PATCH] readserial: allow reading of zero bytes

Vadim Bendebury posted 1 patch 6 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/seabios tags/patchew/CAC3GErGa8kvYYsWRGkK0Q32oU8hmkXiV+8GsG6kaKERAYW2CRA@mail.gmail.com
scripts/readserial.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[SeaBIOS] [PATCH] readserial: allow reading of zero bytes
Posted by Vadim Bendebury 6 years, 4 months ago
Certain serial device drivers might return without reading anything,
returning empty buffer. This is not an indication of the interface
being shut down, the readserial utility should keep running.

Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
---
 scripts/readserial.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/readserial.py b/scripts/readserial.py
index a7383e8..ffb076f 100755
--- a/scripts/readserial.py
+++ b/scripts/readserial.py
@@ -71,7 +71,7 @@ def readserial(infile, logfile, byteadjust):
                 continue
         d = infile.read(4096)
         if not d:
-            return 0
+            continue
         datatime = time.time()

         datatime -= len(d) * byteadjust
-- 
2.15.1.504.g5279b80103-goog

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios