From: Richard Levitte Date: Wed, 19 Sep 2018 19:33:45 +0000 (+0200) Subject: crypto/ui/ui_openssl.c: make sure to recognise ENXIO and EIO too X-Git-Tag: OpenSSL_1_1_1a~148 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=226e6a2cf2797aed7ed59eeb05858b5a7491a0ad;p=oweals%2Fopenssl.git crypto/ui/ui_openssl.c: make sure to recognise ENXIO and EIO too These both indicate that the file descriptor we're trying to use as a terminal isn't, in fact, a terminal. Fixes #7271 Reviewed-by: Matthias St. Pierre (Merged from https://github.com/openssl/openssl/pull/7272) (cherry picked from commit 276bf8620ce35a613c856f2b70348f65ffe94067) --- diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c index 45d48202b5..6b996134df 100644 --- a/crypto/ui/ui_openssl.c +++ b/crypto/ui/ui_openssl.c @@ -415,6 +415,24 @@ static int open_console(UI *ui) is_a_tty = 0; else # endif +# ifdef ENXIO + /* + * Solaris can return ENXIO. + * This should be ok + */ + if (errno == ENXIO) + is_a_tty = 0; + else +# endif +# ifdef EIO + /* + * Linux can return EIO. + * This should be ok + */ + if (errno == EIO) + is_a_tty = 0; + else +# endif # ifdef ENODEV /* * MacOS X returns ENODEV (Operation not supported by device),