Fix: return EINVAL if agent registration fails
authorDavid Goulet <dgoulet@efficios.com>
Tue, 7 Oct 2014 19:05:48 +0000 (15:05 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 16 Nov 2014 12:36:28 +0000 (07:36 -0500)
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 <dgoulet@efficios.com>
src/bin/lttng-sessiond/agent-thread.c

index 56613a54f605853ecfab18867b37e621681a34e5..2c018e9c686050263651f9c7ec54552ef45b536c 100644 (file)
@@ -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);
This page took 0.025069 seconds and 4 git commands to generate.