diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2001-05-17 11:47:08 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2001-05-17 11:47:08 +0000 |
commit | b49a5b2dc02545b137101797cacb060ae19c264a (patch) | |
tree | e312ff55cfa6840d0cc05a522b426ea18e01ff05 /crypto/ui/ui_openssl.c | |
parent | 713f22611450ea878bfe65ec34d02ad18928ce36 (diff) | |
download | openssl-b49a5b2dc02545b137101797cacb060ae19c264a.tar.gz |
Fix for new UI functions under Win32.
For some unknown reason fopen("con", "w") is the
only way to make this work. Using "r+" and "w+"
causes the fopen call to fail and the fallback
(using stdin) doesn't work because writing to stdin
fails.
Diffstat (limited to 'crypto/ui/ui_openssl.c')
-rw-r--r-- | crypto/ui/ui_openssl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c index 3555ae6275..abf223b5d1 100644 --- a/crypto/ui/ui_openssl.c +++ b/crypto/ui/ui_openssl.c @@ -430,7 +430,10 @@ static int open_console(UI *ui) is_a_tty = 1; #ifdef OPENSSL_SYS_MSDOS - if ((tty=fopen("con","w+")) == NULL) + /* For some bizarre reason this call to fopen() on Windows + * fails if the mode is "w+" or "r+", whereas "w" works fine. + */ + if ((tty=fopen("con","w")) == NULL) tty=stdin; #elif defined(OPENSSL_SYS_MACINTOSH_CLASSIC) tty=stdin; |