Simply close socket when application registration is refused
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 19 Nov 2011 17:17:03 +0000 (12:17 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 19 Nov 2011 17:17:03 +0000 (12:17 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-sessiond/main.c
lttng-sessiond/ust-app.c

index 0acf230e0d09c9553be4e0f2a688b3c8ca8bc244..54dcbdff06f68965b8f2923160825e180bfe65c9 100644 (file)
@@ -1060,9 +1060,10 @@ static void *thread_manage_apps(void *data)
                                        /* Register applicaton to the session daemon */
                                        ret = ust_app_register(&ust_cmd.reg_msg,
                                                        ust_cmd.sock);
-                                       if (ret < 0) {
-                                               /* Only critical ENOMEM error can be returned here */
+                                       if (ret == -ENOMEM) {
                                                goto error;
+                                       } else if (ret < 0) {
+                                               break;
                                        }
 
                                        /*
index 6c9d40f421ff1c0fabbe93c8b5676c85000f3f0d..ab65f2b1576f2d20ccbdff0bc89e488f81bc2e91 100644 (file)
@@ -846,6 +846,7 @@ int ust_app_register(struct ust_register_msg *msg, int sock)
                        "%d-bit lttng-consumerd is available.\n",
                        msg->name, msg->pid, msg->bits_per_long,
                        CAA_BITS_PER_LONG);
+               close(sock);
                return -EINVAL;
        }
 
This page took 0.033661 seconds and 4 git commands to generate.