summaryrefslogtreecommitdiffstats
path: root/audio/out/push.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/push.c')
-rw-r--r--audio/out/push.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/audio/out/push.c b/audio/out/push.c
index c271fc0cdc..c4083923fd 100644
--- a/audio/out/push.c
+++ b/audio/out/push.c
@@ -423,8 +423,11 @@ static void destroy_no_thread(struct ao *ao)
ao->driver->uninit(ao);
- for (int n = 0; n < 2; n++)
- close(p->wakeup_pipe[n]);
+ for (int n = 0; n < 2; n++) {
+ int h = p->wakeup_pipe[n];
+ if (h >= 0)
+ close(h);
+ }
pthread_cond_destroy(&p->wakeup);
pthread_mutex_destroy(&p->lock);