From 711a9f393e2cd31b5a6c41e7506a722b9a8c5e30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 10 Sep 2019 20:17:34 -0400 Subject: [PATCH] Clean-up: lttng: check status returned when checking rotation state MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng/commands/destroy.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.34.1