summaryrefslogtreecommitdiffstats
path: root/crypto/ui
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-12-07 20:28:43 +0100
committerRichard Levitte <richard@levitte.org>2016-12-08 14:10:19 +0100
commit58f5f4157bc3533ed7cace90e4e9a89e19497cba (patch)
tree2566d600e6b5e90c5fff30d172dcaa7b65225aa8 /crypto/ui
parentdc76164c7693f57a6ded33a1344f2e8c1d6a0ee6 (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) (cherry picked from commit c901bccec6f747467e1af31473655c8290e32309)
Diffstat (limited to 'crypto/ui')
-rw-r--r--crypto/ui/ui_openssl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c
index cd25a6d971..1965d1e19d 100644
--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -424,6 +424,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);