From 23e4607cc55838e8f7d3d1461f4630a48271c541 Mon Sep 17 00:00:00 2001 From: Trek H Date: Wed, 9 Feb 2022 16:21:02 +1030 Subject: [PATCH] alsa: return n where applicable in alsa.Read --- device/alsa/alsa.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/device/alsa/alsa.go b/device/alsa/alsa.go index 7dab252f..ae7109b3 100644 --- a/device/alsa/alsa.go +++ b/device/alsa/alsa.go @@ -436,10 +436,10 @@ func (d *ALSA) Read(p []byte) (int, error) { switch err { case nil, io.EOF: d.l.Log(logger.Debug, pkg+"EOF") - return 0, nil + return n, nil default: d.l.Log(logger.Error, pkg+"unexpected error from Read", "error", err.Error()) - return 0, nil + return n, nil } } d.l.Log(logger.Debug, fmt.Sprintf("%v read %v bytes", pkg, n))