From a9f62579ba95dd4ac20376a0f2f63455ef73aa45 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 15 May 2026 13:20:31 +0200 Subject: [PATCH] support: make sure loop_add_io is closes the fd when asked When the close argument is true, loop_add_io is supposed to close the fd even when an error occurs. This makes it possible to have spa_steal_fd() work even in the case of errors. --- spa/plugins/support/loop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spa/plugins/support/loop.c b/spa/plugins/support/loop.c index 11c3fa222..6b8010af3 100644 --- a/spa/plugins/support/loop.c +++ b/spa/plugins/support/loop.c @@ -922,6 +922,8 @@ error_exit_free: free(source); errno = -res; error_exit: + if (close) + spa_system_close(impl->system, fd); return NULL; }