commit 9d62a95c0910f1907c107ece867828d66c15dcf2
parent d4192e9452f21de5828958f09df1f772affde73a
Author: sin <sin@2f30.org>
Date: Mon, 6 Jun 2016 13:39:52 +0100
Correctly report sio_write() error to caller
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/ncmixer.c b/ncmixer.c
@@ -168,9 +168,14 @@ err0:
}
int
-audio_play(struct sio_hdl *sio_hdl, void *buf, int n)
+audio_play(struct sio_hdl *sio_hdl, void *buf, int len)
{
- return sio_write(sio_hdl, buf, n);
+ int n;
+
+ n = sio_write(sio_hdl, buf, len);
+ if (n == 0 && sio_eof(sio_hdl) != 0)
+ return -1;
+ return n;
}
void