Tests fix: initialize kernel extended channel attributes
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 5 May 2017 17:36:30 +0000 (13:36 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 5 May 2017 17:36:30 +0000 (13:36 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/trace-kernel.c
tests/unit/test_kernel_data.c

index d6ee8e8afb23401b2420e430bdd892dd0acc714d..876fda5bbb7fd9ed8d25c0cafdd3c348ec466e7c 100644 (file)
@@ -522,10 +522,12 @@ void trace_kernel_destroy_channel(struct ltt_kernel_channel *channel)
        /* Remove from channel list */
        cds_list_del(&channel->list);
 
-       status = notification_thread_command_remove_channel(
-                       notification_thread_handle,
-                       channel->fd, LTTNG_DOMAIN_KERNEL);
-       assert(status == LTTNG_OK);
+       if (notification_thread_handle) {
+               status = notification_thread_command_remove_channel(
+                               notification_thread_handle,
+                               channel->fd, LTTNG_DOMAIN_KERNEL);
+               assert(status == LTTNG_OK);
+       }
        free(channel->channel->attr.extended.ptr);
        free(channel->channel);
        free(channel);
index ad4666b6ff675b5275d1f4034ba4ee1d24af43b1..ff1b75df4f3025f934398b6b9218dd4d34fda6cc 100644 (file)
@@ -116,8 +116,11 @@ static void test_create_kernel_channel(void)
 {
        struct ltt_kernel_channel *chan;
        struct lttng_channel attr;
+       struct lttng_channel_extended extended;
 
        memset(&attr, 0, sizeof(attr));
+       memset(&extended, 0, sizeof(extended));
+       attr.attr.extended.ptr = &extended;
 
        chan = trace_kernel_create_channel(&attr);
        ok(chan != NULL, "Create kernel channel");
This page took 0.033238 seconds and 4 git commands to generate.