From 10a50374bfcff8fd27e8b39a0de20869d64ca346 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 7 Dec 2016 20:28:43 +0100 Subject: 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 (Merged from https://github.com/openssl/openssl/pull/2039) (cherry picked from commit c901bccec6f747467e1af31473655c8290e32309) --- crypto/ui/ui_openssl.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crypto') diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c index 377384b050..17d14f5842 100644 --- a/crypto/ui/ui_openssl.c +++ b/crypto/ui/ui_openssl.c @@ -508,6 +508,15 @@ static int open_console(UI *ui) if (errno == EINVAL) 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 return 0; } -- cgit v1.2.3