Eric Pouech : ntdll: Fixed getting the RTS status from line, and now using sane default values for all (compilation/system) cases.
Alexandre Julliard
julliard at winehq.org
Tue Jan 22 06:01:52 CST 2008
Module: wine
Branch: master
Commit: 2ea3dd12b13814cd9643c4216d817bf8488275a1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2ea3dd12b13814cd9643c4216d817bf8488275a1
Author: Eric Pouech <eric.pouech at orange.fr>
Date: Mon Jan 21 21:45:18 2008 +0100
ntdll: Fixed getting the RTS status from line, and now using sane default values for all (compilation/system) cases.
---
dlls/ntdll/serial.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c
index 6866b95..c54d706 100644
--- a/dlls/ntdll/serial.c
+++ b/dlls/ntdll/serial.c
@@ -188,24 +188,29 @@ static NTSTATUS get_baud_rate(int fd, SERIAL_BAUD_RATE* sbr)
static NTSTATUS get_hand_flow(int fd, SERIAL_HANDFLOW* shf)
{
- int stat;
+ int stat = 0;
struct termios port;
-
+
if (tcgetattr(fd, &port) == -1)
{
ERR("tcgetattr error '%s'\n", strerror(errno));
return FILE_GetNtStatus();
}
+ /* termios does not support DTR/DSR flow control */
+ shf->ControlHandShake = 0;
+ shf->FlowReplace = 0;
#ifdef TIOCMGET
if (ioctl(fd, TIOCMGET, &stat) == -1)
{
WARN("ioctl error '%s'\n", strerror(errno));
- stat = DTR_CONTROL_ENABLE | RTS_CONTROL_ENABLE;
+ shf->ControlHandShake |= SERIAL_DTR_CONTROL;
+ shf->FlowReplace |= SERIAL_RTS_CONTROL;
}
+#else
+ WARN("Setting DTR/RTS to enabled by default\n");
+ shf->ControlHandShake |= SERIAL_DTR_CONTROL;
+ shf->FlowReplace |= SERIAL_RTS_CONTROL;
#endif
- /* termios does not support DTR/DSR flow control */
- shf->ControlHandShake = 0;
- shf->FlowReplace = 0;
#ifdef TIOCM_DTR
if (stat & TIOCM_DTR)
#endif
@@ -213,7 +218,7 @@ static NTSTATUS get_hand_flow(int fd, SERIAL_HANDFLOW* shf)
#ifdef CRTSCTS
if (port.c_cflag & CRTSCTS)
{
- shf->ControlHandShake |= SERIAL_DTR_CONTROL | SERIAL_DTR_HANDSHAKE;
+ shf->FlowReplace |= SERIAL_RTS_CONTROL;
shf->ControlHandShake |= SERIAL_CTS_HANDSHAKE;
}
else
@@ -222,7 +227,7 @@ static NTSTATUS get_hand_flow(int fd, SERIAL_HANDFLOW* shf)
#ifdef TIOCM_RTS
if (stat & TIOCM_RTS)
#endif
- shf->ControlHandShake |= SERIAL_RTS_CONTROL;
+ shf->FlowReplace |= SERIAL_RTS_CONTROL;
}
if (port.c_iflag & IXOFF)
shf->FlowReplace |= SERIAL_AUTO_RECEIVE;
More information about the wine-cvs
mailing list