commit 9071e7aaf3a12ea712e22d17d261b51766d9f7f6 parent 2b3ed27b5266a539ae42872c6460e08456df9256 Author: sin <sin@2f30.org> Date: Thu, 25 Dec 2014 14:51:41 +0000 Add some error checking for changing volume Diffstat:
M | sndio.c | | | 5 | ++++- |
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sndio.c b/sndio.c @@ -18,7 +18,10 @@ sndioinit(void) static int sndiovol(int vol) { - sio_setvol(hdl, (SIO_MAXVOL * vol) / 100); + if (!sio_setvol(hdl, (SIO_MAXVOL * vol) / 100)) { + warnx("sio_setvol: failed"); + return -1; + } return 0; }