Add unsupported error code to lttng cmd line
authorDavid Goulet <dgoulet@efficios.com>
Mon, 25 Mar 2013 19:07:30 +0000 (15:07 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 25 Mar 2013 19:07:30 +0000 (15:07 -0400)
Fixes #438

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng/command.h
src/bin/lttng/commands/enable_events.c
src/bin/lttng/lttng.c

index 68ce903dedde11dc341eeb3a3eb9970567c0b77a..21585383f03978b3d0d221163a5c91da588db792 100644 (file)
@@ -31,6 +31,7 @@ enum cmd_error_code {
        CMD_UNDEFINED,
        CMD_FATAL,
        CMD_WARNING,
+       CMD_UNSUPPORTED,
 };
 
 struct cmd_struct {
index 231dac3fbd50c4cdf295c89c20ca1038182cedd5..93ef0c5a4c090ab94e7ddc22e2acd8a803daff34 100644 (file)
@@ -497,7 +497,7 @@ static int enable_events(char *session_name)
 
                        if (opt_loglevel) {
                                MSG("Kernel loglevels are not supported.");
-                               ret = CMD_UNDEFINED;
+                               ret = CMD_UNSUPPORTED;
                                goto error;
                        }
 
@@ -530,7 +530,7 @@ static int enable_events(char *session_name)
                        case LTTNG_EVENT_SYSCALL:
                        default:
                                ERR("Event type not available for user-space tracing");
-                               ret = CMD_UNDEFINED;
+                               ret = CMD_UNSUPPORTED;
                                goto error;
                        }
 
index d3aaa8424683b58c189d2c8f9afc894f5d937bf2..90c031fafaaf655cd124d494ef207e2ba8b7c0c2 100644 (file)
@@ -272,7 +272,7 @@ static int handle_command(int argc, char **argv)
        }
 
        /* Command not found */
-       ret = -1;
+       ret = CMD_UNDEFINED;
 
 end:
        return ret;
@@ -499,6 +499,9 @@ static int parse_args(int argc, char **argv)
        case CMD_FATAL:
                ERR("Fatal error");
                break;
+       case CMD_UNSUPPORTED:
+               ERR("Unsupported command");
+               break;
        case -1:
                usage(stderr);
                ret = 1;
This page took 0.027162 seconds and 4 git commands to generate.