From: Jérémie Galarneau Date: Wed, 11 Sep 2019 00:17:34 +0000 (-0400) Subject: Clean-up: lttng: check status returned when checking rotation state X-Git-Tag: v2.12.0-rc1~406 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=7d81aa9fff703f8fcf35f8ac426aa37d0ffffb16;hp=eaeb64a96cf1ecf2a1b6e654a74bb38892bbfd9e Clean-up: lttng: check status returned when checking rotation state While the use of the destruction handle in the lttng client guarantees that obtaining the rotation's state will succeed, it is a poor example to give of using this API. Moreover, we don't wait to give the impression that this could never change. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c index a258f6409..cac1e96fd 100644 --- a/src/bin/lttng/commands/destroy.c +++ b/src/bin/lttng/commands/destroy.c @@ -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;