From 05f8afa9c72f0c673628dd5aeb6e8abcab6a5bf8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 9 Apr 2018 15:15:35 -0400 Subject: [PATCH] Fix: use signed member to transport enum value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- include/lttng/rotate-internal.h | 4 ++-- src/bin/lttng-sessiond/cmd.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/lttng/rotate-internal.h b/include/lttng/rotate-internal.h index 74c85b0b6..e359cd741 100644 --- a/include/lttng/rotate-internal.h +++ b/include/lttng/rotate-internal.h @@ -87,7 +87,7 @@ struct lttng_rotation_get_info_return { /* Represents values defined in enum lttng_rotation_state. */ int32_t status; /* Represents values defined in enum lttng_rotation_state. */ - uint8_t location_type; + int8_t location_type; union { struct { char absolute_path[LTTNG_PATH_MAX]; @@ -98,7 +98,7 @@ struct lttng_rotation_get_info_return { * Represents values defined in * enum lttng_trace_archive_location_relay_protocol_type. */ - uint8_t protocol; + int8_t protocol; struct { uint16_t control; uint16_t data; diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index ad635a9a9..4c5160764 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -4648,7 +4648,7 @@ int cmd_rotate_get_info(struct ltt_session *session, current_tracing_path_reply_len = sizeof(info_return->location.local.absolute_path); info_return->location_type = - (uint8_t) LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_LOCAL; + (int8_t) LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_LOCAL; break; case CONSUMER_DST_NET: current_tracing_path_reply = @@ -4657,7 +4657,7 @@ int cmd_rotate_get_info(struct ltt_session *session, sizeof(info_return->location.relay.relative_path); /* Currently the only supported relay protocol. */ info_return->location.relay.protocol = - (uint8_t) LTTNG_TRACE_ARCHIVE_LOCATION_RELAY_PROTOCOL_TYPE_TCP; + (int8_t) LTTNG_TRACE_ARCHIVE_LOCATION_RELAY_PROTOCOL_TYPE_TCP; ret = lttng_strncpy(info_return->location.relay.host, session_get_net_consumer_hostname(session), @@ -4673,7 +4673,7 @@ int cmd_rotate_get_info(struct ltt_session *session, &info_return->location.relay.ports.control, &info_return->location.relay.ports.data); info_return->location_type = - (uint8_t) LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_RELAY; + (int8_t) LTTNG_TRACE_ARCHIVE_LOCATION_TYPE_RELAY; break; default: abort(); -- 2.34.1