diff options
author | Richard Levitte <levitte@openssl.org> | 2016-12-07 20:28:43 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-12-08 13:37:48 +0100 |
commit | c901bccec6f747467e1af31473655c8290e32309 (patch) | |
tree | 2441e54c7c5fef3400f24ea7e446626f63e970b2 /crypto | |
parent | 4984448648f69ed4425df68900b1fd6f17c6c271 (diff) |
UI_OpenSSL()'s session opener fails on MacOS X
If on a non-tty stdin, TTY_get() will fail with errno == ENODEV.
We didn't catch that.
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2039)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/ui/ui_openssl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c index a9acd98b4a..00ad2b6992 100644 --- a/crypto/ui/ui_openssl.c +++ b/crypto/ui/ui_openssl.c @@ -429,6 +429,15 @@ static int open_console(UI *ui) is_a_tty = 0; else # endif +# ifdef ENODEV + /* + * MacOS X returns ENODEV (Operation not supported by device), + * which seems appropriate. + */ + if (errno == ENODEV) + is_a_tty = 0; + else +# endif { char tmp_num[10]; BIO_snprintf(tmp_num, sizeof(tmp_num) - 1, "%d", errno); |