From e37c37c64ff100d236ecc0436c802e5917880ca1 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 7 Oct 2014 15:05:48 -0400 Subject: [PATCH 1/1] 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 --- src/bin/lttng-sessiond/jul-thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng-sessiond/jul-thread.c b/src/bin/lttng-sessiond/jul-thread.c index d8748f2a5..a683cdcdb 100644 --- a/src/bin/lttng-sessiond/jul-thread.c +++ b/src/bin/lttng-sessiond/jul-thread.c @@ -206,7 +206,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; } pid = be32toh(msg.pid); -- 2.34.1