Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: $BAUD is strange on Linux for 115200




On Mon, 24 Jun 1996, Zoltan Hidvegi wrote:
[about the following patch]
> >  # 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

> 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.

For me, it's ok; but I thought it were there for purpose.  Maybe POSIX
doesn't define that speed_t can only contain Bxxxx constants, or some
(maybe non-POSIX) systems are broken in this aspect, or maybe some can
get away with B9600=9600 and so they don't really need constants...

This way, we hopefully won't break on anyone's system...  Or, that's what
beta-testing is for? :)

Janos




Messages sorted by: Reverse Date, Date, Thread, Author