X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fsession.c;h=6c30821ff1348a405816af553a7b2951120c8a5c;hb=16100d7ad8517131cc3ef29743e325184802ad13;hp=f40f70965c97d6a1ceffdf85a066a7a282dd1d1c;hpb=19efdf659e29ec34a27c304ccbf7ad6ff8e26337;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/session.c b/src/bin/lttng-relayd/session.c index f40f70965..6c30821ff 100644 --- a/src/bin/lttng-relayd/session.c +++ b/src/bin/lttng-relayd/session.c @@ -220,6 +220,7 @@ static int session_set_anonymous_chunk(struct relay_session *session) goto end; } + lttng_trace_chunk_set_fd_tracker(chunk, the_fd_tracker); status = lttng_trace_chunk_set_credentials_current_user(chunk); if (status != LTTNG_TRACE_CHUNK_STATUS_OK) { ret = -1; @@ -232,8 +233,6 @@ static int session_set_anonymous_chunk(struct relay_session *session) goto end; } - lttng_trace_chunk_set_fd_tracker(chunk, the_fd_tracker); - output_directory = NULL; session->current_trace_chunk = chunk; chunk = NULL; end: @@ -344,6 +343,12 @@ struct relay_session *session_create(const char *session_name, } if (creation_time) { LTTNG_OPTIONAL_SET(&session->creation_time, *creation_time); + } else { + LTTNG_OPTIONAL_SET(&session->creation_time, time(NULL)); + if (session->creation_time.value == (time_t) -1) { + PERROR("Failed to sample session creation time"); + goto error; + } } session->session_name_contains_creation_time = session_name_contains_creation_time;