- if (session->rotation_status == LTTNG_ROTATION_STATUS_ERROR) {
- DBG("An error occurred during rotation");
- (*pending_return)->status = LTTNG_ROTATION_STATUS_ERROR;
- /* Rotate with a relay */
- } else if (session->rotate_pending_relay) {
- DBG("Session %s, rotate_id %" PRIu64 " still pending",
- session->name, session->rotate_count);
- (*pending_return)->status = LTTNG_ROTATION_STATUS_STARTED;
- } else if (session->rotate_pending) {
- DBG("Session %s, rotate_id %" PRIu64 " still pending",
- session->name, session->rotate_count);
- (*pending_return)->status = LTTNG_ROTATION_STATUS_STARTED;
- } else {
- DBG("Session %s, rotate_id %" PRIu64 " finished",
- session->name, session->rotate_count);
- (*pending_return)->status = LTTNG_ROTATION_STATUS_COMPLETED;
- ret = lttng_strncpy((*pending_return)->output_path,
+ switch (session->rotation_state) {
+ case LTTNG_ROTATION_STATE_ONGOING:
+ DBG("Reporting that rotation id %" PRIu64 " of session %s is still pending",
+ rotation_id, session->name);
+ break;
+ case LTTNG_ROTATION_STATE_COMPLETED:
+ ret = lttng_strncpy(info_return->path,