Fix: move testpoint after state update
[lttng-tools.git] / src / bin / lttng-sessiond / register.c
index c7e3de66ff1f22ac378731b8228f10b84634a30f..d57a564cf6ec6f38ec5210f9a7397931eedc695a 100644 (file)
@@ -175,7 +175,7 @@ static void *thread_application_registration(void *data)
 
        DBG("[thread] Manage application registration started");
 
-       pthread_cleanup_push(thread_init_cleanup, NULL);
+       pthread_cleanup_push(thread_init_cleanup, thread_state);
        health_register(health_sessiond, HEALTH_SESSIOND_TYPE_APP_REG);
 
        ret = lttcomm_listen_unix_sock(application_socket);
@@ -183,10 +183,6 @@ static void *thread_application_registration(void *data)
                goto error_listen;
        }
 
-       if (testpoint(sessiond_thread_registration_apps)) {
-               goto error_create_poll;
-       }
-
        /*
         * Pass 2 as size here for the thread quit pipe and apps_sock. Nothing
         * more will be added to this poll set.
@@ -211,6 +207,10 @@ static void *thread_application_registration(void *data)
        set_thread_status(thread_state, true);
        pthread_cleanup_pop(0);
 
+       if (testpoint(sessiond_thread_registration_apps)) {
+               goto error_poll_add;
+       }
+
        while (1) {
                DBG("Accepting application registration");
 
@@ -278,6 +278,7 @@ static void *thread_application_registration(void *data)
                                                if (ret) {
                                                        PERROR("close");
                                                }
+                                               sock = -1;
                                                goto error;
                                        }
 
This page took 0.024859 seconds and 5 git commands to generate.