Add missing rcu_read_unlock on error paths
[lttng-tools.git] / liblttng-ustconsumer / lttng-ustconsumer.c
index 1e0bf55ec70727578bbff92fe921ba8af74b55ca..db0ba05bd6a160c691b77eff6fe8808a2032dd45 100644 (file)
@@ -29,9 +29,9 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <ust/lttng-ust-ctl.h>
 #include <lttng-sessiond-comm.h>
 #include <lttng/lttng-ustconsumer.h>
+#include <lttng/ust-ctl.h>
 #include <lttngerr.h>
 
 extern struct lttng_consumer_global_data consumer_data;
@@ -261,7 +261,7 @@ end_nosignal:
 
 int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan)
 {
-       struct object_data obj;
+       struct lttng_ust_object_data obj;
 
        obj.handle = -1;
        obj.shm_fd = chan->shm_fd;
@@ -271,6 +271,12 @@ int lttng_ustconsumer_allocate_channel(struct lttng_consumer_channel *chan)
        if (!chan->handle) {
                return -ENOMEM;
        }
+       /*
+        * The channel fds are passed to ustctl, we only keep a copy.
+        */
+       chan->shm_fd_is_copy = 1;
+       chan->wait_fd_is_copy = 1;
+
        return 0;
 }
 
@@ -281,7 +287,7 @@ void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan)
 
 int lttng_ustconsumer_allocate_stream(struct lttng_consumer_stream *stream)
 {
-       struct object_data obj;
+       struct lttng_ust_object_data obj;
        int ret;
 
        obj.handle = -1;
@@ -298,6 +304,12 @@ int lttng_ustconsumer_allocate_stream(struct lttng_consumer_stream *stream)
        if (!stream->mmap_base) {
                return -EINVAL;
        }
+       /*
+        * The stream fds are passed to ustctl, we only keep a copy.
+        */
+       stream->shm_fd_is_copy = 1;
+       stream->wait_fd_is_copy = 1;
+
        return 0;
 }
 
This page took 0.024087 seconds and 4 git commands to generate.