Fix ust consumer channel memory non-zeroed allocation
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 9 Nov 2011 16:09:39 +0000 (11:09 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 9 Nov 2011 16:09:39 +0000 (11:09 -0500)
The cpu count was expecting memory to be zeroed on allocation. Caused
stream open errors and zero-sized metadata files (and unability to open
channel files).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-consumer/lttng-consumer.c
liblttng-ustconsumer/lttng-ustconsumer.c

index 54338e800619a728f70ca44673c6f346a0ebecc0..c7c7b7a7e4db220f8cbb512cb976746213e24dbe 100644 (file)
@@ -305,7 +305,7 @@ struct lttng_consumer_channel *consumer_allocate_channel(
        struct lttng_consumer_channel *channel;
        int ret;
 
-       channel = malloc(sizeof(*channel));
+       channel = zmalloc(sizeof(*channel));
        if (channel == NULL) {
                perror("malloc struct lttng_consumer_channel");
                goto end;
index 806ebd3c03977f340245ed41e98047a7255461fc..ed4a27c9da927d47ed52cadf129a6592d17fca48 100644 (file)
@@ -175,7 +175,6 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                                msg.u.channel.mmap_len,
                                msg.u.channel.max_sb_size);
                if (new_channel == NULL) {
-                       fprintf(stderr, "AAAAA\n");
                        lttng_consumer_send_error(ctx, CONSUMERD_OUTFD_ERROR);
                        goto end_nosignal;
                }
@@ -218,7 +217,6 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                                msg.u.stream.output,
                                msg.u.stream.path_name);
                if (new_stream == NULL) {
-                       fprintf(stderr, "BBBBBB\n");
                        lttng_consumer_send_error(ctx, CONSUMERD_OUTFD_ERROR);
                        goto end;
                }
This page took 0.025781 seconds and 4 git commands to generate.