From b86d17b103112c5b0061e70450fae38acd67a546 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 28 Oct 2016 16:35:24 -0400 Subject: [PATCH] Make --plugin-path optional MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- converter/babeltrace.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/converter/babeltrace.c b/converter/babeltrace.c index 88d8423e..d6a9faa0 100644 --- a/converter/babeltrace.c +++ b/converter/babeltrace.c @@ -279,12 +279,6 @@ int main(int argc, char **argv) printf_verbose("Verbose mode active.\n"); printf_debug("Debug mode active.\n"); - - if (bt_value_array_is_empty(cfg->plugin_paths)) { - fprintf(stderr, "No plugin path specified, aborting...\n"); - ret = -1; - goto end; - } component_factory = bt_component_factory_create(); if (!component_factory) { fprintf(stderr, "Failed to create component factory.\n"); @@ -292,14 +286,17 @@ int main(int argc, char **argv) goto end; } - first_plugin_path_value = bt_value_array_get(cfg->plugin_paths, 0); - bt_value_string_get(first_plugin_path_value, &first_plugin_path); - - ret = bt_component_factory_load_recursive(component_factory, - first_plugin_path); - if (ret) { - fprintf(stderr, "Failed to load plugins.\n"); - goto end; + if (cfg->plugin_paths && !bt_value_array_is_empty(cfg->plugin_paths)) { + first_plugin_path_value = bt_value_array_get( + cfg->plugin_paths, 0); + bt_value_string_get(first_plugin_path_value, + &first_plugin_path); + ret = bt_component_factory_load_recursive(component_factory, + first_plugin_path); + if (ret) { + fprintf(stderr, "Failed to dynamically load plugins.\n"); + goto end; + } } ret = bt_component_factory_load_static(component_factory); -- 2.34.1