From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id DAA06628 for ; Tue, 25 Jun 1996 03:40:37 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA06273; Mon, 24 Jun 1996 13:15:31 -0400 (EDT) Resent-Date: Mon, 24 Jun 1996 13:15:31 -0400 (EDT) Date: Mon, 24 Jun 1996 19:14:51 +0200 (MET DST) From: Janos Farkas To: zsh-workers@math.gatech.edu Subject: $BAUD is strange on Linux for 115200 Message-ID: X-Mood: in love MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"6dAmO1.0.xX1.pqipn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1431 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu If I am using an 'extended' speed (i.e. >38400), BAUD used to be something like 4098, because the original logic in this code thought that if the speed code returned by cfget?speed() is larger than 100, then it's the real baud rate, not a symbolic value. This is not so on Linux. [Taking the opportunity, I added some recently added baud rates to the list]. Anyone can see any problems with the code below? Janos diff -urN zsh-2.6-beta21.orig/Src/utils.c zsh-2.6-beta21/Src/utils.c --- zsh-2.6-beta21.orig/Src/utils.c Wed Jun 19 22:01:40 1996 +++ zsh-2.6-beta21/Src/utils.c Sun Jun 23 22:55:21 1996 @@ -2715,9 +2715,16 @@ # if defined(HAVE_TCGETATTR) && defined(HAVE_TERMIOS_H) tempbaud = cfgetospeed(&shttyinfo->tio); +#if defined CBAUDEX && CBAUDEX > 100 + /* If we have CBAUDEX, then it's a mask of the extended + speeds, and the baud rates are still encoded. At least + this is so on Linux, and I hope this logic is true on + most systems. */ +#else if (tempbaud >= 100) return tempbaud; else +#endif speedcode = (int) tempbaud; # else speedcode = shttyinfo->tio.c_cflag & CBAUD; @@ -2784,6 +2791,22 @@ case EXTB: return (38400L); # endif +#endif +#ifdef B57600 + case B57600: + return (57600L); +#endif +#ifdef B115200 + case B115200: + return (115200L); +#endif +#ifdef B230400 + case B230400: + return (230400L); +#endif +#ifdef B460800 + case B460800: + return (460800L); #endif default: break;