Clean-up: lttng: check status returned when checking rotation state
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 11 Sep 2019 00:17:34 +0000 (20:17 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 11 Sep 2019 00:17:34 +0000 (20:17 -0400)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/destroy.c

index a258f64097f275c0c116c4cae1232f5dba181544..cac1e96fd8d1f9655f67adf084833880673027a8 100644 (file)
@@ -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;
This page took 0.025906 seconds and 4 git commands to generate.