X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng%2Fcommands%2Fcreate.c;h=dbed8f021568f53c38b37432a078639f911fa77d;hb=af9737e9006817895374706246dcf3d9efbeb58f;hp=3ed9ba0634552e8c7a81c90b8c6e9000f5e3c8cd;hpb=7d29a2477524f7ee2ee46a94e538e6141f5ecc0e;p=lttng-tools.git diff --git a/lttng/commands/create.c b/lttng/commands/create.c index 3ed9ba063..dbed8f021 100644 --- a/lttng/commands/create.c +++ b/lttng/commands/create.c @@ -3,8 +3,8 @@ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * as published by the Free Software Foundation; only version 2 + * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -26,9 +26,9 @@ #include #include -#include "cmd.h" -#include "conf.h" -#include "utils.h" +#include "../cmd.h" +#include "../conf.h" +#include "../utils.h" static char *opt_output_path; static char *opt_session_name; @@ -64,7 +64,7 @@ static void usage(FILE *ofp) */ static int create_session() { - int ret; + int ret, have_name = 0; char name[NAME_MAX]; char *session_name, *traces_path = NULL, *alloc_path = NULL; time_t rawtime; @@ -79,6 +79,7 @@ static int create_session() DBG("Auto session name set to %s", session_name); } else { session_name = opt_session_name; + have_name = 1; } /* Auto output path */ @@ -108,11 +109,18 @@ static int create_session() /* Init lttng session config */ ret = config_init(session_name); if (ret < 0) { + if (ret == -1) { + ret = CMD_ERROR; + } goto error; } MSG("Session %s created.", session_name); - MSG("Traces will be written in %s/%s--