Close stream and channel file descriptors as soon as passed to sessiond
[lttng-ust.git] / libringbuffer / ring_buffer_frontend.c
index d469d04022d94e18379392189a6bd0ee55d5a4b0..d0649f3e36b9e33b0e1b247854fd6a2c000f714a 100644 (file)
@@ -44,6 +44,7 @@
 #include <fcntl.h>
 #include <urcu/compiler.h>
 #include <urcu/ref.h>
+#include <helper.h>
 
 #include "smp.h"
 #include <lttng/ringbuffer-config.h>
@@ -419,7 +420,7 @@ struct lttng_ust_shm_handle *channel_create(const struct lttng_ust_lib_ring_buff
                   void *buf_addr, size_t subbuf_size,
                   size_t num_subbuf, unsigned int switch_timer_interval,
                   unsigned int read_timer_interval,
-                  int *shm_fd, int *wait_fd, uint64_t *memory_map_size)
+                  int **shm_fd, int **wait_fd, uint64_t **memory_map_size)
 {
        int ret, cpu;
        size_t shmsize, chansize;
@@ -609,8 +610,8 @@ struct lttng_ust_lib_ring_buffer *channel_get_ring_buffer(
                                        const struct lttng_ust_lib_ring_buffer_config *config,
                                        struct channel *chan, int cpu,
                                        struct lttng_ust_shm_handle *handle,
-                                       int *shm_fd, int *wait_fd,
-                                       uint64_t *memory_map_size)
+                                       int **shm_fd, int **wait_fd,
+                                       uint64_t **memory_map_size)
 {
        struct shm_ref *ref;
 
@@ -945,12 +946,6 @@ void lib_ring_buffer_print_buffer_errors(struct lttng_ust_lib_ring_buffer *buf,
        const struct lttng_ust_lib_ring_buffer_config *config = &chan->backend.config;
        unsigned long write_offset, cons_offset;
 
-       /*
-        * Can be called in the error path of allocation when
-        * trans_channel_data is not yet set.
-        */
-       if (!chan)
-               return;
        /*
         * No need to order commit_count, write_offset and cons_offset reads
         * because we execute at teardown when no more writer nor reader
This page took 0.027902 seconds and 4 git commands to generate.