X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fdestroy.c;h=26548b9e153521f1b74b2d5c10d44968e7179744;hp=fea96f1757907178ea8e89b7ee6a21bdd18c27be;hb=37d03ff782ab6774cb972549854ebc3f95e7d677;hpb=32a6298d8929c91842c9a5c09f1a3f4660c32eec diff --git a/src/bin/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c index fea96f175..26548b9e1 100644 --- a/src/bin/lttng/commands/destroy.c +++ b/src/bin/lttng/commands/destroy.c @@ -74,10 +74,11 @@ static int destroy_session(const char *session_name) ret = lttng_destroy_session(session_name); if (ret < 0) { switch (-ret) { - case LTTCOMM_SESS_NOT_FOUND: + case LTTNG_ERR_SESS_NOT_FOUND: WARN("Session name %s not found", session_name); break; default: + ERR("%s", lttng_strerror(ret)); break; } goto error; @@ -103,7 +104,11 @@ static int destroy_all_sessions() count = lttng_list_sessions(&sessions); if (count == 0) { MSG("No session found, nothing to do."); + } else if (count < 0) { + ERR("%s", lttng_strerror(ret)); + goto error; } + for (i = 0; i < count; i++) { ret = destroy_session(sessions[i].name); if (ret < 0) { @@ -143,6 +148,13 @@ int cmd_destroy(int argc, const char **argv) goto end; } + /* TODO: mi support */ + if (lttng_opt_mi) { + ret = -LTTNG_ERR_MI_NOT_IMPLEMENTED; + ERR("mi option not supported"); + goto end; + } + /* Ignore session name in case all sessions are to be destroyed */ if (opt_destroy_all) { ret = destroy_all_sessions();