projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix session listing msg when session name not found
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
list.c
diff --git
a/src/bin/lttng/commands/list.c
b/src/bin/lttng/commands/list.c
index f915a16855f2dccbe2d924344febf77f74bda747..c0bd30f2245a1a3597e9e9699d500d925ea0a249 100644
(file)
--- a/
src/bin/lttng/commands/list.c
+++ b/
src/bin/lttng/commands/list.c
@@
-480,7
+480,8
@@
static int list_sessions(const char *session_name)
continue;
}
continue;
}
- MSG(" %d) %s (%s)%s", i + 1, sessions[i].name, sessions[i].path, active_string(sessions[i].enabled));
+ MSG(" %d) %s (%s)%s", i + 1, sessions[i].name, sessions[i].path,
+ active_string(sessions[i].enabled));
if (session_found) {
break;
if (session_found) {
break;
@@
-490,7
+491,9
@@
static int list_sessions(const char *session_name)
free(sessions);
if (!session_found && session_name != NULL) {
free(sessions);
if (!session_found && session_name != NULL) {
- ERR("Session %s not found", session_name);
+ ERR("Session '%s' not found", session_name);
+ ret = CMD_ERROR;
+ goto error;
}
if (session_name == NULL) {
}
if (session_name == NULL) {
@@
-601,39
+604,32
@@
int cmd_list(int argc, const char **argv)
if (session_name == NULL) {
if (!opt_kernel && !opt_userspace) {
ret = list_sessions(NULL);
if (session_name == NULL) {
if (!opt_kernel && !opt_userspace) {
ret = list_sessions(NULL);
- if (ret < 0) {
- ret = CMD_ERROR;
+ if (ret != 0) {
goto end;
}
}
if (opt_kernel) {
ret = list_kernel_events();
if (ret < 0) {
goto end;
}
}
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) {
goto end;
}
}
if (opt_userspace) {
ret = list_ust_events();
if (ret < 0) {
- ret = CMD_ERROR;
goto end;
}
}
} else {
/* List session attributes */
ret = list_sessions(session_name);
goto end;
}
}
} else {
/* List session attributes */
ret = list_sessions(session_name);
- if (ret < 0) {
- ret = CMD_ERROR;
+ if (ret != 0) {
goto end;
}
/* Domain listing */
if (opt_domain) {
ret = list_domains(session_name);
goto end;
}
/* Domain listing */
if (opt_domain) {
ret = list_domains(session_name);
- if (ret < 0) {
- ret = CMD_ERROR;
- }
goto end;
}
goto end;
}
@@
-641,14
+637,13
@@
int cmd_list(int argc, const char **argv)
/* Channel listing */
ret = list_channels(opt_channel);
if (ret < 0) {
/* 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) {
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;
}
goto end;
}
@@
-676,7
+671,6
@@
int cmd_list(int argc, const char **argv)
ret = list_channels(opt_channel);
if (ret < 0) {
ret = list_channels(opt_channel);
if (ret < 0) {
- ret = CMD_ERROR;
goto end;
}
}
goto end;
}
}
This page took
0.025585 seconds
and
4
git commands to generate.