From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: chexum@shadow.banki.hu (Janos Farkas)
Cc: zsh-workers@math.gatech.edu
Subject: Re: $BAUD is strange on Linux for 115200
Date: Mon, 24 Jun 1996 19:54:09 +0200 (MET DST) [thread overview]
Message-ID: <199606241754.TAA05385@bolyai.cs.elte.hu> (raw)
In-Reply-To: <Pine.LNX.3.93.960624191101.7983B-100000@shadow.banki.hu> from Janos Farkas at "Jun 24, 96 07:14:51 pm"
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
next prev parent reply other threads:[~1996-06-24 18:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-06-24 17:14 Janos Farkas
1996-06-24 17:54 ` Zoltan Hidvegi [this message]
1996-06-24 18:15 ` Janos Farkas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199606241754.TAA05385@bolyai.cs.elte.hu \
--to=hzoli@cs.elte.hu \
--cc=chexum@shadow.banki.hu \
--cc=zsh-workers@math.gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).