diff options
author | kinichiro <kinichiro.inoguchi@gmail.com> | 2019-07-28 19:03:27 +0900 |
---|---|---|
committer | kinichiro <kinichiro.inoguchi@gmail.com> | 2019-07-28 19:10:47 +0900 |
commit | 856d0511d63bd791b4a18df0c3ffc80b8e47c470 (patch) | |
tree | 09ca2423dc45ffd4fc21982de10dc19f877a5329 /patches/tls_util.c.patch | |
parent | 0e3d93fc1d008d7561e97ceccc35f092e5fc0f36 (diff) | |
download | portable-856d0511d63bd791b4a18df0c3ffc80b8e47c470.tar.gz portable-856d0511d63bd791b4a18df0c3ffc80b8e47c470.tar.bz2 portable-856d0511d63bd791b4a18df0c3ffc80b8e47c470.zip |
Use posix_win.c functions on WIN32
- read() returns bytes count as 1 for crlf unless binary mode isn't
specified with open(). Reported by @ulfworsoe in libressl-portable#542
- err could be WSANOTINITIALISED when WSAStartup() is not called
Diffstat (limited to '')
-rw-r--r-- | patches/tls_util.c.patch | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/patches/tls_util.c.patch b/patches/tls_util.c.patch deleted file mode 100644 index 9f57d83..0000000 --- a/patches/tls_util.c.patch +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | --- tls/tls_util.c.orig Fri Jul 26 22:17:04 2019 | ||
2 | +++ tls/tls_util.c Fri Jul 26 22:21:22 2019 | ||
3 | @@ -17,6 +17,10 @@ | ||
4 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
5 | */ | ||
6 | |||
7 | +#ifdef _MSC_VER | ||
8 | +#define NO_REDEF_POSIX_FUNCTIONS | ||
9 | +#endif | ||
10 | + | ||
11 | #include <sys/stat.h> | ||
12 | |||
13 | #include <stdlib.h> | ||
14 | @@ -161,7 +165,11 @@ tls_load_file(const char *name, size_t *len, char *pas | ||
15 | |||
16 | *len = 0; | ||
17 | |||
18 | +#ifndef _WIN32 | ||
19 | if ((fd = open(name, O_RDONLY)) == -1) | ||
20 | +#else | ||
21 | + if ((fd = open(name, O_RDONLY | O_BINARY)) == -1) | ||
22 | +#endif | ||
23 | return (NULL); | ||
24 | |||
25 | /* Just load the file into memory without decryption */ | ||