From f89c69c4cf4fdefec36b19b23e318037168ccdfc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alex=20Villac=C3=ADs=20Lasso?= Date: Tue, 27 Sep 2005 09:32:17 +0000 Subject: [PATCH] Tolerate ioctl failure in GetCommState() in order to be capable to use softmodems. --- dlls/kernel/comm.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dlls/kernel/comm.c b/dlls/kernel/comm.c index 4da2b964d68..2f75e2fb9b7 100644 --- a/dlls/kernel/comm.c +++ b/dlls/kernel/comm.c @@ -1491,17 +1491,22 @@ BOOL WINAPI GetCommState( fd = get_comm_fd( handle, GENERIC_READ ); if (fd < 0) return FALSE; - if (tcgetattr(fd, &port) == -1 -#ifdef TIOCMGET - || ioctl(fd, TIOCMGET, &stat) == -1 -#endif - ) { + if (tcgetattr(fd, &port) == -1) { int save_error=errno; - ERR("tcgetattr or ioctl error '%s'\n", strerror(save_error)); + ERR("tcgetattr error '%s'\n", strerror(save_error)); COMM_SetCommError(handle,CE_IOE); release_comm_fd( handle, fd ); return FALSE; } + +#ifdef TIOCMGET + if (ioctl(fd, TIOCMGET, &stat) == -1) + { + int save_error=errno; + WARN("ioctl error '%s'\n", strerror(save_error)); + stat = DTR_CONTROL_ENABLE | RTS_CONTROL_ENABLE; + } +#endif release_comm_fd( handle, fd ); #ifndef __EMX__ #ifdef CBAUD -- 2.11.4.GIT