zsh-workers
 help / color / mirror / code / Atom feed
From: Janos Farkas <chexum@shadow.banki.hu>
To: zsh-workers@math.gatech.edu
Subject: $BAUD is strange on Linux for 115200
Date: Mon, 24 Jun 1996 19:14:51 +0200 (MET DST)	[thread overview]
Message-ID: <Pine.LNX.3.93.960624191101.7983B-100000@shadow.banki.hu> (raw)


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;




             reply	other threads:[~1996-06-24 17:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-24 17:14 Janos Farkas [this message]
1996-06-24 17:54 ` Zoltan Hidvegi
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=Pine.LNX.3.93.960624191101.7983B-100000@shadow.banki.hu \
    --to=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).