From: David Goulet Date: Tue, 14 Aug 2012 17:12:24 +0000 (-0400) Subject: Fix: remove adjustment on written var for metadata X-Git-Tag: v2.1.0-rc1~27 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=09e26845dd435a5975299a380847dad06e0a6836 Fix: remove adjustment on written var for metadata This was generating the following error each time metadata was streamed over the network. Error: Error writing to tracefile The return value was off by 8 bytes which is the header stream id size. However, the "written" variable is not used in the metadata command to the relayd so there is no use of updating it to fit the expected len of the mmap() caller. Signed-off-by: David Goulet --- diff --git a/src/common/consumer.c b/src/common/consumer.c index 761ce9375..0e33bea72 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1095,7 +1095,11 @@ end: } /* - * Mmap the ring buffer, read it and write the data to the tracefile. + * Mmap the ring buffer, read it and write the data to the tracefile. This is a + * core function for writing trace buffers to either the local filesystem or + * the network. + * + * Careful review MUST be put if any changes occur! * * Returns the number of bytes written */ @@ -1168,12 +1172,6 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap( written = ret; goto end; } - - /* - * We do this so the return value can match the len passed as - * argument to this function. - */ - written -= sizeof(stream->relayd_stream_id); } } /* Else, use the default set before which is the filesystem. */