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 15:01:21 +0000 (10:01 -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/jul-thread.c

index d8748f2a5aad5e3c246a0016af7bd72e0a43bde6..a683cdcdbc4756b632ab6c042db474f1c2993b57 100644 (file)
@@ -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);
This page took 0.026065 seconds and 4 git commands to generate.