From 6d15ee456b72efc4dac58666427d203d285f90f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 16 Jun 2022 17:36:41 -0400 Subject: [PATCH] Build fix: missing initializer for member 'rotate_positions' MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gcc 5.4.0 complains that: relayd/relayd.cpp:1221:2: warning: missing initializer for member 'lttcomm_relayd_rotate_streams::rotation_positions' [-Wmissing-field-initializers] The structure's members are initialized one by one. Signed-off-by: Jérémie Galarneau Change-Id: If0ecd9c9b2c5a0861463e93a2a52b0d2b3a36712 --- src/common/relayd/relayd.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/relayd/relayd.cpp b/src/common/relayd/relayd.cpp index f2a190505..e012d2540 100644 --- a/src/common/relayd/relayd.cpp +++ b/src/common/relayd/relayd.cpp @@ -1212,16 +1212,16 @@ int relayd_rotate_streams(struct lttcomm_relayd_sock *sock, unsigned int i; struct lttng_dynamic_buffer payload; struct lttcomm_relayd_generic_reply reply = {}; - const struct lttcomm_relayd_rotate_streams msg = { - .stream_count = htobe32((uint32_t) stream_count), - .new_chunk_id = (typeof(msg.new_chunk_id)) { - .is_set = !!new_chunk_id, - .value = htobe64(new_chunk_id ? *new_chunk_id : 0), - }, - }; + struct lttcomm_relayd_rotate_streams msg; char new_chunk_id_buf[MAX_INT_DEC_LEN(*new_chunk_id)] = {}; const char *new_chunk_id_str; + msg.stream_count = htobe32((uint32_t) stream_count); + msg.new_chunk_id = (typeof(msg.new_chunk_id)){ + .is_set = !!new_chunk_id, + .value = htobe64(new_chunk_id ? *new_chunk_id : 0), + }; + if (!relayd_supports_chunks(sock)) { DBG("Refusing to rotate remote streams: relayd does not support chunks"); return 0; -- 2.34.1