qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yonggang Luo <luoyonggang@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Yonggang Luo" <luoyonggang@gmail.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>
Subject: [PATCH 1/2] gcrypt: test_tls_psk_init should write binary file instead text file.
Date: Tue, 13 Oct 2020 09:03:09 +0800	[thread overview]
Message-ID: <20201013010310.497-2-luoyonggang@gmail.com> (raw)
In-Reply-To: <20201013010310.497-1-luoyonggang@gmail.com>

On windows, if open file with "w", it's will automatically convert
"\n" to "\r\n" when writing to file.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 tests/crypto-tls-psk-helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/crypto-tls-psk-helpers.c b/tests/crypto-tls-psk-helpers.c
index a8395477c3..11ae26368c 100644
--- a/tests/crypto-tls-psk-helpers.c
+++ b/tests/crypto-tls-psk-helpers.c
@@ -32,7 +32,7 @@ void test_tls_psk_init(const char *pskfile)
 {
     FILE *fp;
 
-    fp = fopen(pskfile, "w");
+    fp = fopen(pskfile, "wb");
     if (fp == NULL) {
         g_critical("Failed to create pskfile %s", pskfile);
         abort();
-- 
2.28.0.windows.1



  reply	other threads:[~2020-10-13  1:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13  1:03 [PATCH 0/2] Fixes gcrypt testing on msys2/mingw Yonggang Luo
2020-10-13  1:03 ` Yonggang Luo [this message]
2020-10-13 10:52   ` [PATCH 1/2] gcrypt: test_tls_psk_init should write binary file instead text file Philippe Mathieu-Daudé
2020-10-13  1:03 ` [PATCH 2/2] gcrypt: Enable crypto tests under msys2/mingw Yonggang Luo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201013010310.497-2-luoyonggang@gmail.com \
    --to=luoyonggang@gmail.com \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).