This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
[PATCH] - tc{set,get}attr() error checking and B0 support
- From: Troy Curtiss <tcurtiss at qcpi dot com>
- To: cygwin-patches at cygwin dot com
- Date: Wed, 22 Jan 2003 17:34:36 -0700
- Subject: [PATCH] - tc{set,get}attr() error checking and B0 support
Chris,
Per your comments on my prior patches, I have re-architected my
error-checking changes so that the short-circuiting behavior in
tcsetattr() is gone. I also cleaned up the B0 (ie. drop DTR)
support to more closely resemble what POSIX expects while not enraging
Win32 :) Please let me know if this passes muster - the prior test
case program still applies. My only remaining question is why errno
isn't being propagated back up to the application? Thanks,
-Troy
2003-01-22 Troy Curtiss <troyc@usa.net>
*
fhandler_serial.cc (fhandler_serial::tcsetattr): Add error-checking
so that if
any Win32 SetComm*() calls fail, errno gets set to EINVAL
and tcsetattr() returns -1. Catches invalid
bitrates, mostly.
*
fhandler_serial.cc (fhandler_serial::tcsetattr): If baud rate
setting
is B0, just drop DTR and leave Win32 DCB bitrate
as-is since 0 is not
a valid Win32 setting.
(fhandler_serial::tcgetattr):
If DTR is low, populate the bitrate as B0,
otherwise get it from the DCB. Works
around Win32's lack of bitrate 0
at the expense of using DTR as the flag (POSIX
behavior.)
Attachment:
serial_support_patch
Description: Binary data