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:58 +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 b6c18e142ca6c3e7434e616db17f3499df636d45..ff9d29472c7986387949e449dba2db18180e71a9 100644 (file)
@@ -494,7 +494,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;
                        }
 
@@ -527,7 +527,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 e6ca9cfd9877485339188fbbbf1626f0a8d21ae7..113f69d9ba065e874ded90d555ffb9452ebe9cdf 100644 (file)
@@ -274,7 +274,7 @@ static int handle_command(int argc, char **argv)
        }
 
        /* Command not found */
-       ret = -1;
+       ret = CMD_UNDEFINED;
 
 end:
        return ret;
@@ -498,6 +498,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.026455 seconds and 4 git commands to generate.