From patchwork Mon Sep 19 12:02:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2,2/2] trace: use binary file open mode in simpletrace Date: Mon, 19 Sep 2011 02:02:53 -0000 From: Stefan Hajnoczi X-Patchwork-Id: 115328 Message-Id: <1316433773-17832-3-git-send-email-stefanha@linux.vnet.ibm.com> To: Cc: Paolo Bonzini , Stefan Hajnoczi For Windows portability the simple trace backend must use the 'b' file open mode. This prevents the stdio library from mangling 0x0a/0x0d newline characters. Signed-off-by: Stefan Hajnoczi --- trace/simple.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/trace/simple.c b/trace/simple.c index e29e001..b729c34 100644 --- a/trace/simple.c +++ b/trace/simple.c @@ -234,7 +234,7 @@ void st_set_trace_file_enabled(bool enable) .x1 = HEADER_VERSION, }; - trace_fp = fopen(trace_file_name, "w"); + trace_fp = fopen(trace_file_name, "wb"); if (!trace_fp) { return; }