Commit 79951b1d authored by Richard Levitte's avatar Richard Levitte
Browse files

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: default avatarMatthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/7272)

(cherry picked from commit 276bf862)
(cherry picked from commit ad173035)
parent 5a6fbf61
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -509,6 +509,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),