#include "babeltrace2-plugins.h"
+#include <stdbool.h>
#include <babeltrace2/babeltrace.h>
/* Array of bt_plugin * */
int nr_paths, i, ret = 0;
nr_paths = bt_value_array_get_length(plugin_paths);
- if (nr_paths < 0) {
- BT_CLI_LOGE_APPEND_CAUSE(
- "Cannot load dynamic plugins: no plugin path.");
- ret = -1;
+ if (nr_paths == 0) {
+ BT_LOGI_STR("No dynamic plugin path.");
goto end;
}
}
status = bt_plugin_find_all_from_dir(plugin_path, BT_FALSE,
- BT_FALSE, &plugin_set);
+ BT_TRUE, &plugin_set);
if (status < 0) {
- BT_LOGE("Unable to load dynamic plugins from directory: "
+ BT_CLI_LOGE_APPEND_CAUSE(
+ "Unable to load dynamic plugins from directory: "
"path=\"%s\"", plugin_path);
- continue;
+ ret = status;
+ goto end;
} else if (status ==
BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_NOT_FOUND) {
BT_LOGI("No plugins found in directory: path=\"%s\"",