move windows file IO mode setup to apps_win.c
This commit is contained in:
parent
653bbfaabf
commit
a896d400a0
@ -7,6 +7,9 @@
|
|||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include <io.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include "apps.h"
|
#include "apps.h"
|
||||||
|
|
||||||
double
|
double
|
||||||
@ -27,3 +30,31 @@ app_tminterval(int stop, int usertime)
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
setup_ui(void)
|
||||||
|
{
|
||||||
|
ui_method = UI_create_method("OpenSSL application user interface");
|
||||||
|
UI_method_set_opener(ui_method, ui_open);
|
||||||
|
UI_method_set_reader(ui_method, ui_read);
|
||||||
|
UI_method_set_writer(ui_method, ui_write);
|
||||||
|
UI_method_set_closer(ui_method, ui_close);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set STDIO to binary
|
||||||
|
*/
|
||||||
|
_setmode(_fileno(stdin), _O_BINARY);
|
||||||
|
_setmode(_fileno(stdout), _O_BINARY);
|
||||||
|
_setmode(_fileno(stderr), _O_BINARY);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
destroy_ui(void)
|
||||||
|
{
|
||||||
|
if (ui_method) {
|
||||||
|
UI_destroy_method(ui_method);
|
||||||
|
ui_method = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,26 +1,6 @@
|
|||||||
--- apps/openssl/openssl.c.orig 2015-07-20 02:01:42.000000000 -0600
|
--- apps/openssl/openssl.c.orig Sun Sep 13 09:11:31 2015
|
||||||
+++ apps/openssl/openssl.c 2015-07-20 02:02:00.000000000 -0600
|
+++ apps/openssl/openssl.c Sun Sep 13 09:10:02 2015
|
||||||
@@ -130,6 +130,19 @@
|
@@ -399,7 +399,9 @@
|
||||||
#include <openssl/engine.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#ifdef _WIN32
|
|
||||||
+#include <io.h>
|
|
||||||
+#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"
|
|
||||||
|
|
||||||
@@ -204,7 +216,9 @@
|
|
||||||
static void
|
static void
|
||||||
openssl_startup(void)
|
openssl_startup(void)
|
||||||
{
|
{
|
||||||
@ -28,13 +8,5 @@
|
|||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
CRYPTO_malloc_init();
|
|
||||||
OpenSSL_add_all_algorithms();
|
OpenSSL_add_all_algorithms();
|
||||||
@@ -216,6 +230,7 @@
|
SSL_library_init();
|
||||||
#endif
|
|
||||||
|
|
||||||
setup_ui_method();
|
|
||||||
+ set_stdio_binary();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user