Fix: return EINVAL if agent registration fails
[lttng-tools.git] / src / bin / lttng-sessiond / jul-thread.c
index d8748f2a5aad5e3c246a0016af7bd72e0a43bde6..1630fc55348b983a509432f6fe1d748eb92e683d 100644 (file)
@@ -23,6 +23,8 @@
 #include <common/uri.h>
 #include <common/utils.h>
 
+#include <common/compat/endian.h>
+
 #include "fd-limit.h"
 #include "jul-thread.h"
 #include "lttng-sessiond.h"
@@ -142,8 +144,8 @@ static struct lttcomm_sock *init_tcp_socket(void)
 
        ret = sock->ops->bind(sock);
        if (ret < 0) {
-               WARN("An other session daemon is using this JUL port. JUL support "
-                               "will be deactivated not interfering with the tracing.");
+               WARN("Another session daemon is using this JUL port. JUL support "
+                               "will be deactivated to prevent interfering with the tracing.");
                goto error;
        }
 
@@ -206,7 +208,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.032515 seconds and 4 git commands to generate.