Fix: strlcpy removed in linux 6.8.0-rc1
[lttng-modules.git] / src / lib / ringbuffer / ring_buffer_backend.c
index 9a339be0a6e9b7040abce39b9585a2f2e5d95f48..c3067d039c69cd11176283608dfaa2795a502a11 100644 (file)
@@ -61,7 +61,7 @@ int lib_ring_buffer_backend_allocate(const struct lttng_kernel_ring_buffer_confi
         * end up running out of memory because of this buffer allocation, we
         * want to kill the offending app first.
         */
-       wrapper_set_current_oom_origin();
+       set_current_oom_origin();
 
        num_pages_per_subbuf = num_pages >> get_count_order(num_subbuf);
        subbuf_size = chanb->subbuf_size;
@@ -157,7 +157,7 @@ int lib_ring_buffer_backend_allocate(const struct lttng_kernel_ring_buffer_confi
         * will not fault.
         */
        wrapper_vmalloc_sync_mappings();
-       wrapper_clear_current_oom_origin();
+       clear_current_oom_origin();
        vfree(pages);
        return 0;
 
@@ -174,7 +174,7 @@ depopulate:
 array_error:
        vfree(pages);
 pages_error:
-       wrapper_clear_current_oom_origin();
+       clear_current_oom_origin();
 not_enough_pages:
        return -ENOMEM;
 }
@@ -405,7 +405,11 @@ int channel_backend_init(struct channel_backend *chanb,
        chanb->extra_reader_sb =
                        (config->mode == RING_BUFFER_OVERWRITE) ? 1 : 0;
        chanb->num_subbuf = num_subbuf;
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,8,0))
+       strscpy(chanb->name, name, NAME_MAX);
+#else
        strlcpy(chanb->name, name, NAME_MAX);
+#endif
        memcpy(&chanb->config, config, sizeof(chanb->config));
 
        if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
This page took 0.024489 seconds and 4 git commands to generate.