From: David Goulet Date: Tue, 7 Oct 2014 19:05:48 +0000 (-0400) Subject: Fix: return EINVAL if agent registration fails X-Git-Tag: v2.6.0-rc4~51 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=723af4b44ae4f4217efc0d4a1e879dc76be9c9a3;p=lttng-tools.git Fix: return EINVAL if agent registration fails The errno value might be 0 thus not returning an error if so. It has been seen with an unstable python agent code base which means it could happen in the future if a third part decides to create an agent. Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/agent-thread.c b/src/bin/lttng-sessiond/agent-thread.c index 56613a54f..2c018e9c6 100644 --- a/src/bin/lttng-sessiond/agent-thread.c +++ b/src/bin/lttng-sessiond/agent-thread.c @@ -217,7 +217,7 @@ static int handle_registration(struct lttcomm_sock *reg_sock, size = new_sock->ops->recvmsg(new_sock, &msg, sizeof(msg), 0); if (size < sizeof(msg)) { - ret = -errno; + ret = -EINVAL; goto error_socket; } domain = be32toh(msg.domain);