Simply close socket when application registration is refused
[lttng-tools.git] / lttng-sessiond / main.c
index 3651e6c3e55ed997a4ee4c93f16cf75d9240a8d2..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);
                                        /* 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;
                                                goto error;
+                                       } else if (ret < 0) {
+                                               break;
                                        }
 
                                        /*
                                        }
 
                                        /*
@@ -2822,14 +2823,14 @@ static ssize_t cmd_list_channels(int domain, struct ltt_session *session,
                if (session->kernel_session != NULL) {
                        nb_chan = session->kernel_session->channel_count;
                }
                if (session->kernel_session != NULL) {
                        nb_chan = session->kernel_session->channel_count;
                }
-               DBG3("Number of kernel channels %ld", nb_chan);
+               DBG3("Number of kernel channels %zd", nb_chan);
                break;
        case LTTNG_DOMAIN_UST:
                if (session->ust_session != NULL) {
                        nb_chan = hashtable_get_count(
                                        session->ust_session->domain_global.channels);
                }
                break;
        case LTTNG_DOMAIN_UST:
                if (session->ust_session != NULL) {
                        nb_chan = hashtable_get_count(
                                        session->ust_session->domain_global.channels);
                }
-               DBG3("Number of UST global channels %ld", nb_chan);
+               DBG3("Number of UST global channels %zd", nb_chan);
                break;
        default:
                *channels = NULL;
                break;
        default:
                *channels = NULL;
This page took 0.024086 seconds and 4 git commands to generate.