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-Url: https://git.lttng.org./?a=commitdiff_plain;h=93b4787b203ca4286c29ed484684ed34c3c8fe5d;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 55f5c8035..ed5201240 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -712,7 +712,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();