Fix: ctf: open metadata file using mode "rb"
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 1 Oct 2019 20:04:03 +0000 (16:04 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 2 Oct 2019 16:25:12 +0000 (12:25 -0400)
In the handling of the support info query, we open the metadata file
using the "r" mode.  On Windows, this is a problem when opening
packetized metadata files, which may contain bytes that Windows will
treat as end of lines and transorm.  Use "rb" instead.

This makes the test_trace_copy test pass on Windows.  It currently fails
with the "session-rotation" trace.

Change-Id: Iaa7a3b8def1c07335c5e7e094d82121df56de268
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2110
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
src/plugins/ctf/fs-src/query.c

index 048bc48acd54bd8c2538bc24c5e490cbec4108fa..3deb0cb18f6b7d324b7fb78b75d9d36e9759ffd5 100644 (file)
@@ -447,7 +447,7 @@ bt_component_class_query_method_status support_info_query(
                goto end;
        }
 
-       metadata_file = g_fopen(metadata_path, "r");
+       metadata_file = g_fopen(metadata_path, "rb");
        if (metadata_file) {
                struct ctf_metadata_decoder_config metadata_decoder_config = { 0 };
                enum ctf_metadata_decoder_status decoder_status;
This page took 0.024475 seconds and 4 git commands to generate.