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.4.4~18 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c2ea365bc3d0db6fff8368ba86e262b5d5045665;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 f86670e9c..81b90939c 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -732,7 +732,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();