diff --git a/audio/drivers/oss.c b/audio/drivers/oss.c index 1f8b25cb87..d6d4d28ffa 100644 --- a/audio/drivers/oss.c +++ b/audio/drivers/oss.c @@ -120,7 +120,9 @@ static bool oss_stop(void *data) { int *fd = (int*)data; - ioctl(*fd, SNDCTL_DSP_RESET, 0); + if (ioctl(*fd, SNDCTL_DSP_RESET, 0) < 0) + return false; + oss_is_paused = true; return true; } @@ -155,7 +157,9 @@ static void oss_free(void *data) { int *fd = (int*)data; - ioctl(*fd, SNDCTL_DSP_RESET, 0); + if (ioctl(*fd, SNDCTL_DSP_RESET, 0) < 0) + return; + close(*fd); free(fd); }