[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 13/25] gcrypt: test_tls_psk_init should write binary file inst
From: |
Yonggang Luo |
Subject: |
[PATCH v7 13/25] gcrypt: test_tls_psk_init should write binary file instead text file. |
Date: |
Thu, 10 Sep 2020 18:30:47 +0800 |
On windows, if open file with "w", it's will automatically convert
"\n" to "\r\n" when writing to file.
Convert unlink to use g_remove.
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
tests/crypto-tls-psk-helpers.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/crypto-tls-psk-helpers.c b/tests/crypto-tls-psk-helpers.c
index a8395477c3..58888d5537 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();
@@ -44,7 +46,7 @@ void test_tls_psk_init(const char *pskfile)
void test_tls_psk_cleanup(const char *pskfile)
{
- unlink(pskfile);
+ g_remove(pskfile);
}
#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */
--
2.28.0.windows.1
- [PATCH v7 03/25] block: Fixes nfs compiling error on msys2/mingw, (continued)
- [PATCH v7 03/25] block: Fixes nfs compiling error on msys2/mingw, Yonggang Luo, 2020/09/10
- [PATCH v7 04/25] ci: fixes msys2 build by upgrading capstone to 4.0.2, Yonggang Luo, 2020/09/10
- [PATCH v7 05/25] configure: Fixes ncursesw detection under msys2/mingw and enable curses, Yonggang Luo, 2020/09/10
- [PATCH v7 06/25] win32: Simplify gmtime_r detection direct base on _POSIX_THREAD_SAFE_FUNCTIONS., Yonggang Luo, 2020/09/10
- [PATCH v7 07/25] curses: Fixes curses compiling errors., Yonggang Luo, 2020/09/10
- [PATCH v7 08/25] tests: disable /char/stdio/* tests in test-char.c on win32, Yonggang Luo, 2020/09/10
- [PATCH v7 09/25] tests: Fixes test-replication.c on msys2/mingw., Yonggang Luo, 2020/09/10
- [PATCH v7 10/25] tests: test-replication disable /replication/secondary/* on msys2/mingw., Yonggang Luo, 2020/09/10
- [PATCH v7 11/25] osdep: file locking functions are not available on Win32, Yonggang Luo, 2020/09/10
- [PATCH v7 12/25] meson: Use -b to ignore CR vs. CR-LF issues on Windows, Yonggang Luo, 2020/09/10
- [PATCH v7 13/25] gcrypt: test_tls_psk_init should write binary file instead text file.,
Yonggang Luo <=
- [PATCH v7 14/25] tests: Enable crypto tests under msys2/mingw, Yonggang Luo, 2020/09/10
- [PATCH v7 15/25] meson: remove empty else and duplicated gio deps, Yonggang Luo, 2020/09/10
- [PATCH v7 16/25] vmstate: Fixes test-vmstate.c on msys2/mingw, Yonggang Luo, 2020/09/10