From: David Goulet Date: Thu, 20 Dec 2012 01:21:54 +0000 (-0500) Subject: Fix: return error if sendmsg fails on relayd X-Git-Tag: v2.1.0~7 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4169f5ad171ab88ac181ec4080f46af379bc7676;p=lttng-tools.git Fix: return error if sendmsg fails on relayd Also, remove a FIXME that was refering to something that disapeared (data_size). Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index a73b4852d..6d800f50b 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -958,6 +958,7 @@ error: send_ret = cmd->sock->ops->sendmsg(cmd->sock, &reply, sizeof(reply), 0); if (send_ret < 0) { ERR("Relayd sending session id"); + ret = send_ret; } return ret; @@ -983,7 +984,6 @@ int relay_add_stream(struct lttcomm_relayd_hdr *recv_hdr, goto end_no_session; } - /* FIXME : use data_size for something ? */ ret = cmd->sock->ops->recvmsg(cmd->sock, &stream_info, sizeof(struct lttcomm_relayd_add_stream), 0); if (ret < sizeof(struct lttcomm_relayd_add_stream)) { @@ -1055,6 +1055,7 @@ end: sizeof(struct lttcomm_relayd_status_stream), 0); if (send_ret < 0) { ERR("Relay sending stream id"); + ret = send_ret; } rcu_read_unlock(); @@ -1144,6 +1145,7 @@ end_unlock: sizeof(struct lttcomm_relayd_generic_reply), 0); if (send_ret < 0) { ERR("Relay sending stream id"); + ret = send_ret; } end_no_session: