Fix: missing check on notification thread join
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index b856e126fa3fae8c6cc2c3e3d69ae63dd43a84fc..5a6741f2d0efcfb85ddcc045bcab9127c70c1115 100644 (file)
@@ -600,8 +600,7 @@ static void wait_consumer(struct consumer_data *consumer_data)
        ret = waitpid(consumer_data->pid, &status, 0);
        if (ret == -1) {
                PERROR("consumerd waitpid pid: %d", consumer_data->pid)
-       }
-       if (!WIFEXITED(status)) {
+       } else  if (!WIFEXITED(status)) {
                ERR("consumerd termination with error: %d",
                                WEXITSTATUS(ret));
        }
@@ -6335,13 +6334,13 @@ exit_init_data:
        if (notification_thread_handle) {
                notification_thread_command_quit(notification_thread_handle);
                notification_thread_handle_destroy(notification_thread_handle);
-       }
 
-       ret = pthread_join(notification_thread, &status);
-       if (ret) {
-               errno = ret;
-               PERROR("pthread_join notification thread");
-               retval = -1;
+               ret = pthread_join(notification_thread, &status);
+               if (ret) {
+                       errno = ret;
+                       PERROR("pthread_join notification thread");
+                       retval = -1;
+               }
        }
 
        rcu_thread_offline();
This page took 0.024326 seconds and 4 git commands to generate.