config: get "stty technique" working again on MacOS X.
authorAndy Polyakov <appro@openssl.org>
Thu, 31 Aug 2017 20:48:03 +0000 (22:48 +0200)
committerAndy Polyakov <appro@openssl.org>
Sat, 2 Sep 2017 18:49:47 +0000 (20:49 +0200)
Addresses GH#2167.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4311)

config

diff --git a/config b/config
index c8886de4310797e10b19c0162b0ecdee64920e54..609ed2fba98981a261c4979b783a91331aea9275 100755 (executable)
--- a/config
+++ b/config
@@ -502,9 +502,7 @@ case "$GUESSOS" in
            echo "         invoke 'KERNEL_BITS=64 $THERE/config $options'."
            if [ "$DRYRUN" = "false" -a -t 1 ]; then
              echo "         You have about 5 seconds to press Ctrl-C to abort."
            echo "         invoke 'KERNEL_BITS=64 $THERE/config $options'."
            if [ "$DRYRUN" = "false" -a -t 1 ]; then
              echo "         You have about 5 seconds to press Ctrl-C to abort."
-             # The stty technique used elsewhere doesn't work on
-             # MacOS. At least, right now on this Mac.
-             sleep 5
+             (trap "stty `stty -g`; exit 1" 2; stty -icanon min 0 time 50; read waste; exit 0) <&1 || exit
            fi
        fi
        if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then
            fi
        fi
        if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then