X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fdestroy.c;h=cac1e96fd8d1f9655f67adf084833880673027a8;hp=7cea7bf23303a6a2cadf48709f881f58c79964f5;hb=7d81aa9fff703f8fcf35f8ac426aa37d0ffffb16;hpb=bbbfd84979130a11aebf172cf7d0d24e28165258 diff --git a/src/bin/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c index 7cea7bf23..cac1e96fd 100644 --- a/src/bin/lttng/commands/destroy.c +++ b/src/bin/lttng/commands/destroy.c @@ -101,7 +101,7 @@ static int destroy_session(struct lttng_session *session) fflush(stdout); } - usleep(DEFAULT_DATA_AVAILABILITY_WAIT_TIME); + usleep(DEFAULT_DATA_AVAILABILITY_WAIT_TIME_US); _MSG("."); fflush(stdout); } @@ -127,7 +127,7 @@ static int destroy_session(struct lttng_session *session) do { status = lttng_destruction_handle_wait_for_completion(handle, - DEFAULT_DATA_AVAILABILITY_WAIT_TIME); + DEFAULT_DATA_AVAILABILITY_WAIT_TIME_US / USEC_PER_MSEC); switch (status) { case LTTNG_DESTRUCTION_HANDLE_STATUS_TIMEOUT: if (!printed_wait_msg) { @@ -161,6 +161,10 @@ static int destroy_session(struct lttng_session *session) status = lttng_destruction_handle_get_rotation_state(handle, &rotation_state); + if (status != LTTNG_DESTRUCTION_HANDLE_STATUS_OK) { + ERR("Failed to get rotation state from destruction handle"); + goto skip_wait_rotation; + } switch (rotation_state) { case LTTNG_ROTATION_STATE_NO_ROTATION: break; @@ -192,6 +196,7 @@ static int destroy_session(struct lttng_session *session) skip_wait_rotation: MSG("%sSession \"%s\" destroyed", printed_wait_msg ? "\n" : "", session->name); + printed_wait_msg = false; session_name = get_session_name_quiet(); if (session_name && !strncmp(session->name, session_name, NAME_MAX)) { @@ -208,6 +213,9 @@ skip_wait_rotation: ret = CMD_SUCCESS; error: + if (printed_wait_msg) { + MSG(""); + } lttng_destruction_handle_destroy(handle); free(session_name); return ret;