Fix: intialization of ust_metadata_poll_pipe to garbage value
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.c
index f891828f700afca41c7cb0ea6606c7943efcac1f..7eba01d10da7ebb7f3faaa397847af922229bef8 100644 (file)
@@ -327,8 +327,12 @@ static int create_ust_streams(struct lttng_consumer_channel *channel,
                /* Keep stream reference when creating metadata. */
                if (channel->type == CONSUMER_CHANNEL_TYPE_METADATA) {
                        channel->metadata_stream = stream;
-                       stream->ust_metadata_poll_pipe[0] = ust_metadata_pipe[0];
-                       stream->ust_metadata_poll_pipe[1] = ust_metadata_pipe[1];
+                       if (channel->monitor) {
+                               /* Set metadata poll pipe if we created one */
+                               memcpy(stream->ust_metadata_poll_pipe,
+                                               ust_metadata_pipe,
+                                               sizeof(ust_metadata_pipe));
+                       }
                }
        }
 
This page took 0.023795 seconds and 4 git commands to generate.