From 580f49993946dafd2bcdda6bd94a3aa2f2e7de20 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 22 Feb 2022 12:42:36 +0100 Subject: [PATCH] filter-chain: improve error reporting Don't overwrite the errno from the plugin loader with 0 so that we can actually report the right error. --- src/modules/module-filter-chain.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/module-filter-chain.c b/src/modules/module-filter-chain.c index 66b40d539..39dc4f67c 100644 --- a/src/modules/module-filter-chain.c +++ b/src/modules/module-filter-chain.c @@ -726,7 +726,6 @@ static struct plugin *plugin_load(struct impl *impl, const char *type, const cha { struct fc_plugin *pl = NULL; struct plugin *hndl; - int res = 0; const struct spa_support *support; uint32_t n_support; @@ -750,6 +749,11 @@ static struct plugin *plugin_load(struct impl *impl, const char *type, const cha pl = load_lv2_plugin(support, n_support, path, NULL); } #endif + else { + pl = NULL; + errno = EINVAL; + } + if (pl == NULL) goto exit; @@ -769,9 +773,7 @@ static struct plugin *plugin_load(struct impl *impl, const char *type, const cha spa_list_append(&impl->plugin_list, &hndl->link); return hndl; - exit: - errno = -res; return NULL; }