[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v9 11/26] gcrypt: test_tls_psk_init should write binary file inst
From: |
Yonggang Luo |
Subject: |
[PATCH v9 11/26] gcrypt: test_tls_psk_init should write binary file instead text file. |
Date: |
Tue, 15 Sep 2020 20:13:03 +0800 |
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 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/crypto-tls-psk-helpers.c b/tests/crypto-tls-psk-helpers.c
index a8395477c3..4f3bd446ad 100644
--- a/tests/crypto-tls-psk-helpers.c
+++ b/tests/crypto-tls-psk-helpers.c
@@ -26,13 +26,15 @@
#include "crypto-tls-psk-helpers.h"
#include "qemu/sockets.h"
+#include <glib/gstdio.h>
+
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
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
- [PATCH v9 02/26] ci: fixes msys2 build by upgrading capstone to 4.0.2, (continued)
- [PATCH v9 02/26] ci: fixes msys2 build by upgrading capstone to 4.0.2, Yonggang Luo, 2020/09/15
- [PATCH v9 03/26] configure: Fixes ncursesw detection under msys2/mingw and enable curses, Yonggang Luo, 2020/09/15
- [PATCH v9 04/26] win32: Simplify gmtime_r detection direct base on _POSIX_THREAD_SAFE_FUNCTIONS., Yonggang Luo, 2020/09/15
- [PATCH v9 05/26] curses: Fixes curses compiling errors., Yonggang Luo, 2020/09/15
- [PATCH v9 06/26] tests: disable /char/stdio/* tests in test-char.c on win32, Yonggang Luo, 2020/09/15
- [PATCH v9 07/26] tests: Fixes test-replication.c on msys2/mingw., Yonggang Luo, 2020/09/15
- [PATCH v9 08/26] tests: test-replication disable /replication/secondary/* on msys2/mingw., Yonggang Luo, 2020/09/15
- [PATCH v9 09/26] osdep: file locking functions are not available on Win32, Yonggang Luo, 2020/09/15
- [PATCH v9 10/26] meson: Use -b to ignore CR vs. CR-LF issues on Windows, Yonggang Luo, 2020/09/15
- [PATCH v9 11/26] gcrypt: test_tls_psk_init should write binary file instead text file.,
Yonggang Luo <=
- [PATCH v9 12/26] tests: Enable crypto tests under msys2/mingw, Yonggang Luo, 2020/09/15
- [PATCH v9 13/26] meson: remove empty else and duplicated gio deps, Yonggang Luo, 2020/09/15
- [PATCH v9 14/26] vmstate: Fixes test-vmstate.c on msys2/mingw, Yonggang Luo, 2020/09/15
- [PATCH v9 15/26] cirrus: Building freebsd in a single short, Yonggang Luo, 2020/09/15
- [PATCH v9 16/26] tests: Convert g_free to g_autofree macro in test-logging.c, Yonggang Luo, 2020/09/15
- [PATCH v9 17/26] tests: Fixes test-io-channel-socket.c tests under msys2/mingw, Yonggang Luo, 2020/09/15
- [PATCH v9 18/26] tests: fixes aio-win32 about aio_remove_fd_handler, get it consistence with aio-posix.c, Yonggang Luo, 2020/09/15
- [PATCH v9 19/26] tests: Fixes test-io-channel-file by mask only owner file state mask bits, Yonggang Luo, 2020/09/15