set stdin/out/err to binary mode on Windows

This commit is contained in:
Brent Cook 2015-06-05 03:45:45 -05:00 committed by Brent Cook
parent b239fc25fc
commit 1d27b22e82
2 changed files with 30 additions and 0 deletions

29
patches/openssl.c.patch Normal file
View File

@ -0,0 +1,29 @@
--- apps/openssl.c.orig 2015-06-05 03:42:12.956112944 -0500
+++ apps/openssl.c 2015-06-05 03:41:54.215381908 -0500
@@ -130,6 +130,18 @@
#include <openssl/engine.h>
#endif
+#ifdef _WIN32
+#include <fcntl.h>
+static void set_stdio_binary(void)
+{
+ _setmode(_fileno(stdin), _O_BINARY);
+ _setmode(_fileno(stdout), _O_BINARY);
+ _setmode(_fileno(stderr), _O_BINARY);
+}
+#else
+static void set_stdio_binary(void) {};
+#endif
+
#include "progs.h"
#include "s_apps.h"
@@ -216,6 +228,7 @@
#endif
setup_ui_method();
+ set_stdio_binary();
}
static void

View File

@ -210,6 +210,7 @@ for i in `awk '/SOURCES|HEADERS/ { print $3 }' apps/Makefile.am` ; do
$CP $openssl_app_src/$i apps
fi
done
patch -p0 < patches/openssl.c.patch
# copy libssl source
echo "copying libssl source"