From a9808a3edba243ba62dca8ced67a5f912a5fc0cf Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 7 Jun 2019 13:39:25 +0200 Subject: [PATCH] thread-loop: set error correctly --- src/pipewire/thread-loop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pipewire/thread-loop.c b/src/pipewire/thread-loop.c index 3ed806102..8f5a0406a 100644 --- a/src/pipewire/thread-loop.c +++ b/src/pipewire/thread-loop.c @@ -132,8 +132,10 @@ struct pw_thread_loop *pw_thread_loop_new(struct pw_loop *loop, CHECK(pthread_cond_init(&this->cond, &cattr), clean_lock); CHECK(pthread_cond_init(&this->accept_cond, &cattr), clean_cond); - if ((this->event = pw_loop_add_event(this->loop, do_stop, this)) == NULL) + if ((this->event = pw_loop_add_event(this->loop, do_stop, this)) == NULL) { + res = -errno; goto clean_acceptcond; + } pw_loop_add_hook(loop, &this->hook, &impl_hooks, this);