From 690f6ca372846f13f6ad0122d79e356a80a9219e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 18 Dec 2017 13:17:02 +0100 Subject: [PATCH] module: improve error reporting --- src/pipewire/module.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pipewire/module.c b/src/pipewire/module.c index 087f181d1..c3abf6ab9 100644 --- a/src/pipewire/module.c +++ b/src/pipewire/module.c @@ -165,6 +165,7 @@ struct pw_module *pw_module_load(struct pw_core *core, const char *name, const c void *hnd; char *filename = NULL; const char *module_dir; + int res; pw_module_init_func_t init_func; module_dir = getenv("PIPEWIRE_MODULE_DIR"); @@ -225,7 +226,7 @@ struct pw_module *pw_module_load(struct pw_core *core, const char *name, const c if (this->global != NULL) this->info.id = this->global->id; - if (init_func(this, args) < 0) + if ((res = init_func(this, args)) < 0) goto init_failed; pw_log_debug("loaded module: %s", this->info.name); @@ -246,7 +247,7 @@ struct pw_module *pw_module_load(struct pw_core *core, const char *name, const c free(filename); return NULL; init_failed: - pw_log_error("\"%s\" failed to initialize", filename); + pw_log_error("\"%s\" failed to initialize: %s", filename, spa_strerror(res)); pw_module_destroy(this); return NULL; }