Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-02-01 07:48:03 +0300
committerChristopher Faylor <me@cgf.cx>2003-02-01 07:48:03 +0300
commitb0a82a859dde5807c66ed4eee81f8788905ed43e (patch)
tree2d1e6b61e38252d5cbf61f248ec0b99c4341d011 /winsup/cygwin/termios.cc
parentaa0a22481648f6629938ea3dfe412946b5866bad (diff)
* fhandler_serial.cc (fhandler_serial::open): Avoid extraneous setting of res.
* termios.cc (tcsetattr): Correctly record errno after tcsetattr call. * 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. Catch invalid bitrates, mostly. 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.
Diffstat (limited to 'winsup/cygwin/termios.cc')
-rw-r--r--winsup/cygwin/termios.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/winsup/cygwin/termios.cc b/winsup/cygwin/termios.cc
index 13b5e5251..ac1c89bf0 100644
--- a/winsup/cygwin/termios.cc
+++ b/winsup/cygwin/termios.cc
@@ -144,8 +144,7 @@ tcsetattr (int fd, int a, const struct termios *t)
case bg_ok:
if (cfd.isopen ())
res = cfd->tcsetattr (a, t);
- else
- e = get_errno ();
+ e = get_errno ();
break;
case bg_signalled:
if (thisframe.call_signal_handler ())