Fix: sessiond: use system LTTng-UST headers when available
[lttng-tools.git] / src / bin / lttng-sessiond / ust-consumer.c
index 43bf2616a2c4a93ba91f81f2a6f60476289dbe7c..8dc0fd905ae823d53709dd498dc68583acfb288a 100644 (file)
@@ -30,6 +30,7 @@
 #include "consumer.h"
 #include "health-sessiond.h"
 #include "ust-consumer.h"
+#include "lttng-ust-error.h"
 #include "buffer-registry.h"
 #include "session.h"
 #include "lttng-sessiond.h"
@@ -321,7 +322,6 @@ int ust_consumer_get_channel(struct consumer_socket *socket,
                        free(stream);
                        if (ret == -LTTNG_UST_ERR_NOENT) {
                                DBG3("UST app consumer has no more stream available");
-                               ret = 0;
                                break;
                        }
                        if (ret != -EPIPE) {
@@ -506,7 +506,9 @@ int ust_consumer_metadata_request(struct consumer_socket *socket)
 
                        memset(&msg, 0, sizeof(msg));
                        msg.cmd_type = LTTNG_ERR_UND;
+                       pthread_mutex_lock(socket->lock);
                        (void) consumer_send_msg(socket, &msg);
+                       pthread_mutex_unlock(socket->lock);
                        /*
                         * This is possible since the session might have been destroyed
                         * during a consumer metadata request. So here, return gracefully
This page took 0.023717 seconds and 4 git commands to generate.