Fix: typo when closing the consumer client socket
[lttng-tools.git] / src / common / kernel-ctl / kernel-ctl.c
index a93d25102ad4bb7b2bf6a4afe8ad5d0edd3fb096..b45efd0efa1dc7e6b5e8520419d9f7f6dff99ebd 100644 (file)
@@ -82,7 +82,13 @@ int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops)
                old_channel.switch_timer_interval = chops->switch_timer_interval;
                old_channel.read_timer_interval = chops->read_timer_interval;
                old_channel.output = chops->output;
-               memcpy(old_channel.padding, chops->padding, sizeof(old_channel.padding));
+
+               memset(old_channel.padding, 0, sizeof(old_channel.padding));
+               /*
+                * The new channel padding is smaller than the old ABI so we use the
+                * new ABI padding size for the memcpy.
+                */
+               memcpy(old_channel.padding, chops->padding, sizeof(chops->padding));
 
                return ioctl(fd, LTTNG_KERNEL_OLD_METADATA, &old_channel);
        }
@@ -111,7 +117,13 @@ int kernctl_create_channel(int fd, struct lttng_channel_attr *chops)
                old_channel.switch_timer_interval = chops->switch_timer_interval;
                old_channel.read_timer_interval = chops->read_timer_interval;
                old_channel.output = chops->output;
-               memcpy(old_channel.padding, chops->padding, sizeof(old_channel.padding));
+
+               memset(old_channel.padding, 0, sizeof(old_channel.padding));
+               /*
+                * The new channel padding is smaller than the old ABI so we use the
+                * new ABI padding size for the memcpy.
+                */
+               memcpy(old_channel.padding, chops->padding, sizeof(chops->padding));
 
                return ioctl(fd, LTTNG_KERNEL_OLD_CHANNEL, &old_channel);
        }
@@ -378,9 +390,3 @@ int kernctl_put_subbuf(int fd)
 {
        return ioctl(fd, RING_BUFFER_PUT_SUBBUF);
 }
-
-/* Set the stream_id */
-int kernctl_set_stream_id(int fd, unsigned long *stream_id)
-{
-       return ioctl(fd, RING_BUFFER_SET_STREAM_ID, stream_id);
-}
This page took 0.02432 seconds and 5 git commands to generate.