From 9cf3eb20220bf3ecfb0d9e4946105e7ea8cb3bf3 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 14 Oct 2015 14:33:43 -0400 Subject: [PATCH] Port: Use LTTNG_HOST_NAME_MAX instead of HOST_NAME_MAX MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- include/lttng/constant.h | 2 ++ src/bin/lttng-relayd/main.c | 4 ++-- src/bin/lttng-relayd/session.h | 2 +- src/common/sessiond-comm/relayd.h | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/lttng/constant.h b/include/lttng/constant.h index edf4c3a8d..d3bc8f4a5 100644 --- a/include/lttng/constant.h +++ b/include/lttng/constant.h @@ -56,4 +56,6 @@ #define LTTNG_NAME_MAX 255 +#define LTTNG_HOST_NAME_MAX 64 + #endif /* LTTNG_CONSTANT_H */ diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 28e52696e..53ffbddf0 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -1069,12 +1069,12 @@ static int relay_create_session(struct lttcomm_relayd_hdr *recv_hdr, struct relay_session *session; struct lttcomm_relayd_status_session reply; char session_name[LTTNG_NAME_MAX]; - char hostname[HOST_NAME_MAX]; + char hostname[LTTNG_HOST_NAME_MAX]; uint32_t live_timer = 0; bool snapshot = false; memset(session_name, 0, LTTNG_NAME_MAX); - memset(hostname, 0, HOST_NAME_MAX); + memset(hostname, 0, LTTNG_HOST_NAME_MAX); memset(&reply, 0, sizeof(reply)); diff --git a/src/bin/lttng-relayd/session.h b/src/bin/lttng-relayd/session.h index de1e44f0d..3ee1c45c3 100644 --- a/src/bin/lttng-relayd/session.h +++ b/src/bin/lttng-relayd/session.h @@ -40,7 +40,7 @@ struct relay_session { */ uint64_t id; char session_name[LTTNG_NAME_MAX]; - char hostname[HOST_NAME_MAX]; + char hostname[LTTNG_HOST_NAME_MAX]; uint32_t live_timer; /* Session in snapshot mode. */ diff --git a/src/common/sessiond-comm/relayd.h b/src/common/sessiond-comm/relayd.h index 1152d28e9..fa45de16a 100644 --- a/src/common/sessiond-comm/relayd.h +++ b/src/common/sessiond-comm/relayd.h @@ -169,7 +169,7 @@ struct lttcomm_relayd_index { */ struct lttcomm_relayd_create_session_2_4 { char session_name[LTTNG_NAME_MAX]; - char hostname[HOST_NAME_MAX]; + char hostname[LTTNG_HOST_NAME_MAX]; uint32_t live_timer; uint32_t snapshot; } LTTNG_PACKED; -- 2.34.1