diff options
author | Brent Cook <busterb@gmail.com> | 2015-06-05 03:45:45 -0500 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2015-06-05 04:50:18 -0500 |
commit | 1d27b22e82ce00d27d0886c8488e4cbed1cb618e (patch) | |
tree | 900465ad2494e1201651e9dcf1b8381ddd50e2be /patches/openssl.c.patch | |
parent | b239fc25fcde7ec6f305fff290bc762d14397d15 (diff) | |
download | portable-1d27b22e82ce00d27d0886c8488e4cbed1cb618e.tar.gz portable-1d27b22e82ce00d27d0886c8488e4cbed1cb618e.tar.bz2 portable-1d27b22e82ce00d27d0886c8488e4cbed1cb618e.zip |
set stdin/out/err to binary mode on Windows
Diffstat (limited to 'patches/openssl.c.patch')
-rw-r--r-- | patches/openssl.c.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/patches/openssl.c.patch b/patches/openssl.c.patch new file mode 100644 index 0000000..c086ba5 --- /dev/null +++ b/patches/openssl.c.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | --- apps/openssl.c.orig 2015-06-05 03:42:12.956112944 -0500 | ||
2 | +++ apps/openssl.c 2015-06-05 03:41:54.215381908 -0500 | ||
3 | @@ -130,6 +130,18 @@ | ||
4 | #include <openssl/engine.h> | ||
5 | #endif | ||
6 | |||
7 | +#ifdef _WIN32 | ||
8 | +#include <fcntl.h> | ||
9 | +static void set_stdio_binary(void) | ||
10 | +{ | ||
11 | + _setmode(_fileno(stdin), _O_BINARY); | ||
12 | + _setmode(_fileno(stdout), _O_BINARY); | ||
13 | + _setmode(_fileno(stderr), _O_BINARY); | ||
14 | +} | ||
15 | +#else | ||
16 | +static void set_stdio_binary(void) {}; | ||
17 | +#endif | ||
18 | + | ||
19 | #include "progs.h" | ||
20 | #include "s_apps.h" | ||
21 | |||
22 | @@ -216,6 +228,7 @@ | ||
23 | #endif | ||
24 | |||
25 | setup_ui_method(); | ||
26 | + set_stdio_binary(); | ||
27 | } | ||
28 | |||
29 | static void | ||