From: David Goulet Date: Fri, 7 Dec 2012 21:03:04 +0000 (-0500) Subject: Fix: Use endpoint status enum value in checks X-Git-Tag: v2.1.0~74 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=79d4ffb7115aa6bd499caeadc3e6c58c36d86864;p=lttng-tools.git Fix: Use endpoint status enum value in checks Signed-off-by: David Goulet --- diff --git a/src/common/consumer.c b/src/common/consumer.c index 51f861e23..ef0d4b7bb 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -917,7 +917,7 @@ static int consumer_update_poll_array( * changed where this function will be called back again. */ if (stream->state != LTTNG_CONSUMER_ACTIVE_STREAM || - stream->endpoint_status) { + stream->endpoint_status == CONSUMER_ENDPOINT_INACTIVE) { continue; } DBG("Active FD %d", stream->wait_fd); @@ -1267,6 +1267,8 @@ end: * core function for writing trace buffers to either the local filesystem or * the network. * + * It must be called with the stream lock held. + * * Careful review MUST be put if any changes occur! * * Returns the number of bytes written @@ -1419,6 +1421,8 @@ end: /* * Splice the data from the ring buffer to the tracefile. * + * It must be called with the stream lock held. + * * Returns the number of bytes spliced. */ ssize_t lttng_consumer_on_read_subbuffer_splice( @@ -1950,7 +1954,7 @@ static void validate_endpoint_status_data_stream(void) rcu_read_lock(); cds_lfht_for_each_entry(data_ht->ht, &iter.iter, stream, node.node) { /* Validate delete flag of the stream */ - if (stream->endpoint_status != CONSUMER_ENDPOINT_INACTIVE) { + if (stream->endpoint_status == CONSUMER_ENDPOINT_ACTIVE) { continue; } /* Delete it right now */ @@ -1975,7 +1979,7 @@ static void validate_endpoint_status_metadata_stream( rcu_read_lock(); cds_lfht_for_each_entry(metadata_ht->ht, &iter.iter, stream, node.node) { /* Validate delete flag of the stream */ - if (!stream->endpoint_status) { + if (stream->endpoint_status == CONSUMER_ENDPOINT_ACTIVE) { continue; } /*