X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=cli%2Fbabeltrace-cfg.c;h=1205b21d88579d9bcad3b25ed07089cf395e367d;hb=b30414d8d92929156a927903e4e63d9d68a72271;hp=759ce3776bc6e37626d0946187a11bc0bac29549;hpb=44514773a92ed494fc9dc8637edcdaa3359baa54;p=babeltrace.git diff --git a/cli/babeltrace-cfg.c b/cli/babeltrace-cfg.c index 759ce377..1205b21d 100644 --- a/cli/babeltrace-cfg.c +++ b/cli/babeltrace-cfg.c @@ -23,7 +23,7 @@ */ #include -#include +#include #include #include "babeltrace-cfg.h" @@ -37,37 +37,38 @@ void destroy_gstring(void *data) * Extracts the various paths from the string arg, delimited by ':', * and appends them to the array value object plugin_paths. */ -enum bt_value_status bt_config_append_plugin_paths( - struct bt_value *plugin_paths, const char *arg) +int bt_config_append_plugin_paths( + bt_value *plugin_paths, const char *arg) { - enum bt_value_status status = BT_VALUE_STATUS_OK; + int ret = 0; GPtrArray *dirs = g_ptr_array_new_with_free_func(destroy_gstring); - int ret; size_t i; if (!dirs) { - status = BT_VALUE_STATUS_ERROR; + ret = -1; goto end; } ret = bt_common_append_plugin_path_dirs(arg, dirs); if (ret) { - status = BT_VALUE_STATUS_ERROR; + ret = -1; goto end; } for (i = 0; i < dirs->len; i++) { GString *dir = g_ptr_array_index(dirs, i); - status = bt_value_array_append_string_element(plugin_paths, dir->str); - if (status != BT_VALUE_STATUS_OK) { - break; + ret = bt_value_array_append_string_element( + plugin_paths, dir->str); + if (ret != BT_VALUE_STATUS_OK) { + ret = -1; + goto end; } } end: g_ptr_array_free(dirs, TRUE); - return status; + return ret; } void bt_config_connection_destroy(struct bt_config_connection *connection)