[lttng-dev] [LTTNG-TOOLS PATCH] Fix: relayd protocol version
Julien Desfossez
jdesfossez at efficios.com
Mon Aug 5 15:10:18 EDT 2013
Since we heritate the relayd protocol version from the sessiond and
relayd version, use the VERSION macro instead of additionnal fields.
Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
---
src/bin/lttng-sessiond/cmd.c | 11 +++++++++--
src/common/sessiond-comm/relayd.h | 3 ---
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c
index 84594ad..07366af 100644
--- a/src/bin/lttng-sessiond/cmd.c
+++ b/src/bin/lttng-sessiond/cmd.c
@@ -491,9 +491,16 @@ static int create_connect_relayd(struct lttng_uri *uri,
{
int ret;
struct lttcomm_relayd_sock *rsock;
+ uint32_t major, minor;
- rsock = lttcomm_alloc_relayd_sock(uri, RELAYD_VERSION_COMM_MAJOR,
- RELAYD_VERSION_COMM_MINOR);
+ ret = sscanf(VERSION, "%10u.%10u", &major, &minor);
+ if (ret < 2) {
+ ERR("Error in scanning version");
+ ret = -1;
+ goto error;
+ }
+
+ rsock = lttcomm_alloc_relayd_sock(uri, major, minor);
if (!rsock) {
ret = LTTNG_ERR_FATAL;
goto error;
diff --git a/src/common/sessiond-comm/relayd.h b/src/common/sessiond-comm/relayd.h
index aa99248..836327c 100644
--- a/src/common/sessiond-comm/relayd.h
+++ b/src/common/sessiond-comm/relayd.h
@@ -27,9 +27,6 @@
#include <lttng/lttng.h>
#include <common/defaults.h>
-#define RELAYD_VERSION_COMM_MAJOR 2
-#define RELAYD_VERSION_COMM_MINOR 2
-
/*
* lttng-relayd communication header.
*/
--
1.7.10.4
More information about the lttng-dev
mailing list