From: Mathieu Desnoyers Date: Tue, 2 Dec 2014 22:21:11 +0000 (-0500) Subject: Fix: undefined operation on last_relay_viewer_session_id X-Git-Tag: v2.5.4~20 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b25f7101a1eedaab3629dcc9f773ec9a47581c65;p=lttng-tools.git Fix: undefined operation on last_relay_viewer_session_id Triggers compiler warning on 32-bit build. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 2af71c18d..b1d8591fe 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -733,7 +733,12 @@ int viewer_connect(struct relay_connection *conn) reply.major = htobe32(reply.major); reply.minor = htobe32(reply.minor); if (conn->type == RELAY_VIEWER_COMMAND) { - reply.viewer_session_id = htobe64(++last_relay_viewer_session_id); + /* + * Increment outside of htobe64 macro, because can be used more than once + * within the macro, and thus the operation may be undefined. + */ + last_relay_viewer_session_id++; + reply.viewer_session_id = htobe64(last_relay_viewer_session_id); } health_code_update();