projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add CMD_WARNING error code
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
add_context.c
diff --git
a/src/bin/lttng/commands/add_context.c
b/src/bin/lttng/commands/add_context.c
index 73aff31130e8e5e5f5489d988bff3583ae8ecc86..a7ab4268ac5401805d83d675639962d834f0fb50 100644
(file)
--- a/
src/bin/lttng/commands/add_context.c
+++ b/
src/bin/lttng/commands/add_context.c
@@
-361,7
+361,7
@@
end:
*/
static int add_context(char *session_name)
{
*/
static int add_context(char *session_name)
{
- int ret = CMD_SUCCESS;
+ int ret = CMD_SUCCESS
, warn = 0
;
struct lttng_event_context context;
struct lttng_domain dom;
struct ctx_type *type;
struct lttng_event_context context;
struct lttng_domain dom;
struct ctx_type *type;
@@
-373,7
+373,7
@@
static int add_context(char *session_name)
dom.type = LTTNG_DOMAIN_UST;
} else {
ERR("Please specify a tracer (-k/--kernel or -u/--userspace)");
dom.type = LTTNG_DOMAIN_UST;
} else {
ERR("Please specify a tracer (-k/--kernel or -u/--userspace)");
- ret = CMD_
UNDEFINED
;
+ ret = CMD_
ERROR
;
goto error;
}
goto error;
}
@@
-404,6
+404,7
@@
static int add_context(char *session_name)
opt_channel_name);
if (ret < 0) {
ERR("%s: ", type->opt->symbol);
opt_channel_name);
if (ret < 0) {
ERR("%s: ", type->opt->symbol);
+ warn = 1;
continue;
} else {
MSG("%s context %s added to %s event in %s",
continue;
} else {
MSG("%s context %s added to %s event in %s",
@@
-418,6
+419,13
@@
static int add_context(char *session_name)
error:
lttng_destroy_handle(handle);
error:
lttng_destroy_handle(handle);
+ /*
+ * This means that at least one add_context failed and tells the user to
+ * look on stderr for error(s).
+ */
+ if (warn) {
+ ret = CMD_WARNING;
+ }
return ret;
}
return ret;
}
This page took
0.023897 seconds
and
4
git commands to generate.