From: Jérémie Galarneau Date: Thu, 30 Aug 2018 18:45:23 +0000 (-0400) Subject: Fix: incorrect error message on metadata missing argument X-Git-Tag: v2.10.6~39 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=245751d8d99ca5322076734d6b425f51efbf708a;p=lttng-tools.git Fix: incorrect error message on metadata missing argument Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/commands/metadata.c b/src/bin/lttng/commands/metadata.c index 4a5ab8198..663099dfd 100644 --- a/src/bin/lttng/commands/metadata.c +++ b/src/bin/lttng/commands/metadata.c @@ -82,12 +82,14 @@ static int metadata_regenerate(int argc, const char **argv) int ret; if (argc > 1) { - ret = -LTTNG_ERR_INVALID; + ret = CMD_UNDEFINED; goto end; } ret = lttng_regenerate_metadata(session_name); if (ret == 0) { MSG("Metadata successfully regenerated for session %s", session_name); + } else { + ERR("%s", lttng_strerror(ret)); } end: @@ -100,8 +102,8 @@ static int handle_command(const char **argv) int ret = CMD_SUCCESS, i = 0, argc, command_ret = CMD_SUCCESS; if (argv == NULL) { - ERR("argv is null"); - command_ret = CMD_ERROR; + ERR("No action specified for metadata command."); + ret = CMD_ERROR; goto end; } @@ -221,12 +223,7 @@ int cmd_metadata(int argc, const char **argv) command_ret = handle_command(poptGetArgs(pc)); if (command_ret) { - switch (-command_ret) { - default: - ERR("%s", lttng_strerror(command_ret)); - success = 0; - break; - } + success = 0; } if (lttng_opt_mi) {