X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fcreate.c;h=2778ef553cdd2a24c27567f780be0b1c950678c6;hp=fcf6e128941877a46322827b046e3d79e5043c6d;hb=3badf2bf32930336a4902002d840402adb6859e1;hpb=d14d33bf091e72b23b1f90ea18a0a01bed098b76 diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c index fcf6e1289..2778ef553 100644 --- a/src/bin/lttng/commands/create.c +++ b/src/bin/lttng/commands/create.c @@ -28,6 +28,8 @@ #include "../command.h" #include "../utils.h" +#include + static char *opt_output_path; static char *opt_session_name; @@ -113,12 +115,21 @@ static int create_session() goto error; } } else { - traces_path = opt_output_path; + traces_path = expand_full_path(opt_output_path); + if (traces_path == NULL) { + ret = CMD_ERROR; + goto error; + } } ret = lttng_create_session(session_name, traces_path); if (ret < 0) { /* Don't set ret so lttng can interpret the sessiond error. */ + switch (-ret) { + case LTTCOMM_EXIST_SESS: + WARN("Session %s already exists", session_name); + break; + } goto error; }