[lttng-dev] [PATCH babeltrace] Fix: memstream compat layer requires use of babeltrace_close_memstream

Jérémie Galarneau jeremie.galarneau at efficios.com
Thu Oct 15 14:39:20 EDT 2015


Merged, thanks!

Jérémie

On Thu, Oct 15, 2015 at 12:08 PM, Michael Jeanson <mjeanson at efficios.com> wrote:
> From: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
>
> In compatibility mode, the babeltrace compat layer around memstream
> copies the file content into the buffer only at close.
>
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
> ---
>  formats/lttng-live/lttng-live-comm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/formats/lttng-live/lttng-live-comm.c b/formats/lttng-live/lttng-live-comm.c
> index 91e344c..6422e65 100644
> --- a/formats/lttng-live/lttng-live-comm.c
> +++ b/formats/lttng-live/lttng-live-comm.c
> @@ -932,8 +932,9 @@ int get_new_metadata(struct lttng_live_ctx *ctx,
>                 }
>         } while (ret > 0 || !len_read);
>
> -       if (fclose(metadata_stream->metadata_fp_write))
> -               perror("fclose");
> +       if (babeltrace_close_memstream(metadata_buf, &size,
> +                       metadata_stream->metadata_fp_write))
> +               perror("babeltrace_close_memstream");
>         metadata_stream->metadata_fp_write = NULL;
>
>  error:
> --
> 1.9.1
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list