From 9aa69a722da49bd311e069dddc5c452e9e566531 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 1 Oct 2019 16:04:03 -0400 Subject: [PATCH] Fix: ctf: open metadata file using mode "rb" 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 Reviewed-on: https://review.lttng.org/c/babeltrace/+/2110 Tested-by: jenkins Reviewed-by: Francis Deslauriers Reviewed-by: Michael Jeanson --- src/plugins/ctf/fs-src/query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/ctf/fs-src/query.c b/src/plugins/ctf/fs-src/query.c index 048bc48a..3deb0cb1 100644 --- a/src/plugins/ctf/fs-src/query.c +++ b/src/plugins/ctf/fs-src/query.c @@ -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; -- 2.34.1