diff options
Diffstat (limited to 'crypto/ui/ui_openssl.c')
-rw-r--r-- | crypto/ui/ui_openssl.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c index 06270f09c..10111efbf 100644 --- a/crypto/ui/ui_openssl.c +++ b/crypto/ui/ui_openssl.c @@ -122,7 +122,9 @@ * sigaction and fileno included. -pedantic would be more appropriate for * the intended purposes, but we can't prevent users from adding -ansi. */ -#define _POSIX_C_SOURCE 1 +#if !defined(OPENSSL_SYS_VXWORKS) +# define _POSIX_C_SOURCE 1 +#endif #include <signal.h> #include <stdio.h> #include <string.h> @@ -297,7 +299,7 @@ static int is_a_tty; /* Declare static functions */ #if !defined(OPENSSL_SYS_WIN16) && !defined(OPENSSL_SYS_WINCE) -static int read_till_nl(FILE *); +static void read_till_nl(FILE *); static void recsig(int); static void pushsig(void); static void popsig(void); @@ -390,16 +392,14 @@ static int read_string(UI *ui, UI_STRING *uis) #if !defined(OPENSSL_SYS_WIN16) && !defined(OPENSSL_SYS_WINCE) /* Internal functions to read a string without echoing */ -static int read_till_nl(FILE *in) +static void read_till_nl(FILE *in) { #define SIZE 4 char buf[SIZE+1]; do { - if (!fgets(buf,SIZE,in)) - return 0; + fgets(buf,SIZE,in); } while (strchr(buf,'\n') == NULL); - return 1; } static volatile sig_atomic_t intr_signal; @@ -447,8 +447,7 @@ static int read_string_inner(UI *ui, UI_STRING *uis, int echo, int strip_nl) *p='\0'; } else - if (!read_till_nl(tty_in)) - goto error; + read_till_nl(tty_in); if (UI_set_result(ui, uis, result) >= 0) ok=1; @@ -680,8 +679,6 @@ static int noecho_fgets(char *buf, int size, FILE *tty) size--; #ifdef WIN16TTY i=_inchar(); -#elif defined(_WIN32) - i=_getch(); #else i=getch(); #endif |