[lttng-dev] [PATCH lttng-tools] Fix: destroy session removes the default config file

Partha Pratim Mukherjee ppm.floss at gmail.com
Wed May 20 14:59:01 EDT 2015


Destroy session command by default removes the default config file
without checking the current session. As a result when we call any
other command which expects a default session by calling
get_session_name() function, it fails.

This patch will fix this by checking that the default config file gets
removed only when destroy session is called with the current session.

Fixes: #887

Signed-off-by: Partha Pratim Mukherjee <ppm.floss at gmail.com>
---
 src/bin/lttng/commands/destroy.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/bin/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c
index 95343c9..3fcecc2 100644
--- a/src/bin/lttng/commands/destroy.c
+++ b/src/bin/lttng/commands/destroy.c
@@ -90,7 +90,9 @@ static int destroy_session(struct lttng_session *session)
 	}
 
 	MSG("Session %s destroyed", session->name);
-	config_destroy_default();
+	if (strncmp(session->name, get_session_name(), NAME_MAX) == 0) {
+		config_destroy_default();
+	}
 
 	if (lttng_opt_mi) {
 		ret = mi_lttng_session(writer, session, 0);
-- 
1.7.10.4




More information about the lttng-dev mailing list