alsa: return n where applicable in alsa.Read

This commit is contained in:
Trek H 2022-02-09 16:21:02 +10:30
parent 1abca8cd7e
commit 23e4607cc5
1 changed files with 2 additions and 2 deletions

View File

@ -436,10 +436,10 @@ func (d *ALSA) Read(p []byte) (int, error) {
switch err { switch err {
case nil, io.EOF: case nil, io.EOF:
d.l.Log(logger.Debug, pkg+"EOF") d.l.Log(logger.Debug, pkg+"EOF")
return 0, nil return n, nil
default: default:
d.l.Log(logger.Error, pkg+"unexpected error from Read", "error", err.Error()) 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)) d.l.Log(logger.Debug, fmt.Sprintf("%v read %v bytes", pkg, n))