Build fix: use ret directly in error handling path
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 10 Nov 2014 22:35:26 +0000 (17:35 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 10 Nov 2014 22:35:26 +0000 (17:35 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/enable_events.c

index cba349e636abafc520fdddf72c72832e91cc2b84..11eebc022d8085fd56a4ece4edcf8f0d3e5e02b6 100644 (file)
@@ -637,7 +637,7 @@ static int enable_events(char *session_name)
                                                        msg,
                                                        print_channel_name(channel_name),
                                                        session_name);
-                                       error = 1;
+                                       ret = CMD_ERROR;
                                        break;
                                }
                                default:
@@ -720,7 +720,7 @@ static int enable_events(char *session_name)
                                                        msg,
                                                        print_channel_name(channel_name),
                                                        session_name, opt_filter);
-                                       error = 1;
+                                       ret = CMD_ERROR;
                                        break;
                                }
                                default:
@@ -898,6 +898,7 @@ static int enable_events(char *session_name)
                                                        event_name,
                                                        exclusion_string,
                                                        print_channel_name(channel_name), session_name);
+                                       warn = 1;
                                        break;
                                case LTTNG_ERR_TRACE_ALREADY_STARTED:
                                {
@@ -907,7 +908,7 @@ static int enable_events(char *session_name)
                                                        msg,
                                                        print_channel_name(channel_name),
                                                        session_name);
-                                       error = 1;
+                                       ret = CMD_ERROR;
                                        break;
                                }
                                default:
@@ -918,9 +919,9 @@ static int enable_events(char *session_name)
                                                                ? print_raw_channel_name(channel_name)
                                                                : print_channel_name(channel_name),
                                                        session_name);
+                                       warn = 1;
                                        break;
                                }
-                               warn = 1;
                        } else {
                                MSG("%s event %s%s created in channel %s",
                                                get_domain_str(dom.type), event_name,
@@ -954,7 +955,7 @@ static int enable_events(char *session_name)
                                                        msg,
                                                        print_channel_name(channel_name),
                                                        session_name, opt_filter);
-                                       error = 1;
+                                       ret = CMD_ERROR;
                                        break;
                                }
                                default:
This page took 0.027304 seconds and 4 git commands to generate.