[lttng-dev] [PATCH lttng-tool] Fix: wrong behavior of save command when no session name is provided

Jonathan Rajotte Julien jonathan.r.julien at gmail.com
Tue Jun 17 15:59:41 EDT 2014


No session name and no option --all should default to --all.

Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien at gmail.com>
---
 src/bin/lttng/commands/save.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/bin/lttng/commands/save.c b/src/bin/lttng/commands/save.c
index e8a4565..9be7103 100644
--- a/src/bin/lttng/commands/save.c
+++ b/src/bin/lttng/commands/save.c
@@ -93,12 +93,9 @@ int cmd_save(int argc, const char **argv)
 
 	if (!opt_save_all) {
 		session_name = poptGetArg(pc);
-		if (!session_name) {
-			ERR("A session name must be provided if the \"all\" option is not used.");
-			ret = CMD_ERROR;
-			goto end;
+		if (session_name) {
+			DBG2("Session name: %s", session_name);
 		}
-		DBG2("Session name: %s", session_name);
 	}
 
 	attr = lttng_save_session_attr_create();
-- 
2.0.0




More information about the lttng-dev mailing list