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 EAA07440 for ; Tue, 25 Jun 1996 04:31:08 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA07503; Mon, 24 Jun 1996 13:54:31 -0400 (EDT) Resent-Date: Mon, 24 Jun 1996 13:54:31 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199606241754.TAA05385@bolyai.cs.elte.hu> Subject: Re: $BAUD is strange on Linux for 115200 To: chexum@shadow.banki.hu (Janos Farkas) Date: Mon, 24 Jun 1996 19:54:09 +0200 (MET DST) Cc: zsh-workers@math.gatech.edu In-Reply-To: from Janos Farkas at "Jun 24, 96 07:14:51 pm" Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368 X-Mailer: ELM [version 2.4ME+ PL16 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"p422q1.0.9r1.CPjpn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1435 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Janos Farkas wrote: > > 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; Is'n it better to move the tempbaud >= 100 check to the default case in switch (speedcode) (modifying the type of speedcode from int to long)? I'm sure that if cfgetospeed() returns the value of a B... macro than its the logical meaning should always be used. Zoltan