Fix: memstream compat layer requires use of babeltrace_close_memstream
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 15 Oct 2015 16:08:48 +0000 (12:08 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Fri, 16 Oct 2015 19:40:34 +0000 (15:40 -0400)
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@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/lttng-live/lttng-live-comm.c

index e339add6e6981a767e403661440c151ec48ba02a..8509377c271014e2b7d0a27328e419ce66f08698 100644 (file)
@@ -932,8 +932,10 @@ 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:
This page took 0.043141 seconds and 4 git commands to generate.