Fix return value of list command
authorDavid Goulet <dgoulet@efficios.com>
Thu, 2 Feb 2012 15:17:16 +0000 (10:17 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 2 Feb 2012 15:17:16 +0000 (10:17 -0500)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng/commands/list.c

index da287f5caf9c4a7658b30f4419cf1be7aebb66bb..250e4d8f6a0f60f73e201dba514fbd640628c33c 100644 (file)
@@ -608,14 +608,12 @@ int cmd_list(int argc, const char **argv)
                if (opt_kernel) {
                        ret = list_kernel_events();
                        if (ret < 0) {
-                               ret = CMD_ERROR;
                                goto end;
                        }
                }
                if (opt_userspace) {
                        ret = list_ust_events();
                        if (ret < 0) {
-                               ret = CMD_ERROR;
                                goto end;
                        }
                }
@@ -629,9 +627,6 @@ int cmd_list(int argc, const char **argv)
                /* Domain listing */
                if (opt_domain) {
                        ret = list_domains(session_name);
-                       if (ret < 0) {
-                               ret = CMD_ERROR;
-                       }
                        goto end;
                }
 
@@ -639,14 +634,13 @@ int cmd_list(int argc, const char **argv)
                        /* Channel listing */
                        ret = list_channels(opt_channel);
                        if (ret < 0) {
-                               ret = CMD_ERROR;
                                goto end;
                        }
                } else {
                        /* We want all domain(s) */
                        nb_domain = lttng_list_domains(session_name, &domains);
                        if (nb_domain < 0) {
-                               ret = CMD_ERROR;
+                               ret = nb_domain;
                                goto end;
                        }
 
@@ -674,7 +668,6 @@ int cmd_list(int argc, const char **argv)
 
                                ret = list_channels(opt_channel);
                                if (ret < 0) {
-                                       ret = CMD_ERROR;
                                        goto end;
                                }
                        }
This page took 0.026621 seconds and 4 git commands to generate.