diff options
author | Brent Cook <bcook@openbsd.org> | 2015-09-13 09:19:26 -0500 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2015-09-13 09:31:41 -0500 |
commit | a896d400a0bd65512e7c779306aae7480ee079b4 (patch) | |
tree | db52c01b2569ea9e6d8209694c232c86a37af63c /apps | |
parent | 653bbfaabf6f089c15118df821e51bea75ab7792 (diff) | |
download | portable-a896d400a0bd65512e7c779306aae7480ee079b4.tar.gz portable-a896d400a0bd65512e7c779306aae7480ee079b4.tar.bz2 portable-a896d400a0bd65512e7c779306aae7480ee079b4.zip |
move windows file IO mode setup to apps_win.c
Diffstat (limited to 'apps')
-rw-r--r-- | apps/openssl/compat/apps_win.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/apps/openssl/compat/apps_win.c b/apps/openssl/compat/apps_win.c index 496ac03..37bfcc9 100644 --- a/apps/openssl/compat/apps_win.c +++ b/apps/openssl/compat/apps_win.c | |||
@@ -7,6 +7,9 @@ | |||
7 | 7 | ||
8 | #include <windows.h> | 8 | #include <windows.h> |
9 | 9 | ||
10 | #include <io.h> | ||
11 | #include <fcntl.h> | ||
12 | |||
10 | #include "apps.h" | 13 | #include "apps.h" |
11 | 14 | ||
12 | double | 15 | double |
@@ -27,3 +30,31 @@ app_tminterval(int stop, int usertime) | |||
27 | } | 30 | } |
28 | return 0; | 31 | return 0; |
29 | } | 32 | } |
33 | |||
34 | int | ||
35 | setup_ui(void) | ||
36 | { | ||
37 | ui_method = UI_create_method("OpenSSL application user interface"); | ||
38 | UI_method_set_opener(ui_method, ui_open); | ||
39 | UI_method_set_reader(ui_method, ui_read); | ||
40 | UI_method_set_writer(ui_method, ui_write); | ||
41 | UI_method_set_closer(ui_method, ui_close); | ||
42 | |||
43 | /* | ||
44 | * Set STDIO to binary | ||
45 | */ | ||
46 | _setmode(_fileno(stdin), _O_BINARY); | ||
47 | _setmode(_fileno(stdout), _O_BINARY); | ||
48 | _setmode(_fileno(stderr), _O_BINARY); | ||
49 | |||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | void | ||
54 | destroy_ui(void) | ||
55 | { | ||
56 | if (ui_method) { | ||
57 | UI_destroy_method(ui_method); | ||
58 | ui_method = NULL; | ||
59 | } | ||
60 | } | ||