Use a temporary snapshot_id in cmd_rotate_get_info() to obtain the
return value of cmd_snapshot_add_output() and explicitly assign it to
the reply communication structure. Otherwise, &reply.id may be
unaligned.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
}
case LTTNG_SNAPSHOT_ADD_OUTPUT:
{
+ uint32_t snapshot_id;
struct lttcomm_lttng_output_id reply;
ret = cmd_snapshot_add_output(cmd_ctx->session,
- &cmd_ctx->lsm->u.snapshot_output.output, &reply.id);
+ &cmd_ctx->lsm->u.snapshot_output.output, &snapshot_id);
if (ret != LTTNG_OK) {
goto error;
}
+ reply.id = snapshot_id;
ret = setup_lttng_msg_no_cmd_header(cmd_ctx, &reply,
sizeof(reply));