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>
}
} 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: