From: Richard Levitte Date: Wed, 7 Dec 2016 19:28:43 +0000 (+0100) Subject: UI_OpenSSL()'s session opener fails on MacOS X X-Git-Tag: OpenSSL_1_1_0d~95 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=58f5f4157bc3533ed7cace90e4e9a89e19497cba;p=oweals%2Fopenssl.git 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) --- 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 @@ -423,6 +423,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 { char tmp_num[10];