Fix: incorrect error message on regenerate missing argument
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Aug 2018 18:49:29 +0000 (14:49 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 13 Sep 2018 21:31:02 +0000 (17:31 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/regenerate.c

index 5c982c8a68752ef440c462f4f1fd5eb97790ff01..c73528785db49ff7472465640e07eb220ce69580 100644 (file)
@@ -78,12 +78,14 @@ static int regenerate_metadata(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:
@@ -113,7 +115,7 @@ 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");
+               ERR("No object specified for regenerate command.");
                command_ret = CMD_ERROR;
                goto end;
        }
@@ -234,12 +236,7 @@ int cmd_regenerate(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) {
This page took 0.026195 seconds and 4 git commands to generate.