Module: wine Branch: master Commit: d21b05b06d019ee351a1feb4cd8f6e006a19f460 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d21b05b06d019ee351a1feb4cd...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Tue Aug 27 17:41:10 2013 +0900
ntdll: Properly test line status register for TIOCSER_TEMT bit.
---
dlls/ntdll/serial.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c index bb025cf..7f56cb5 100644 --- a/dlls/ntdll/serial.c +++ b/dlls/ntdll/serial.c @@ -804,6 +804,8 @@ typedef struct async_commio */ static NTSTATUS get_irq_info(int fd, serial_irq_info *irq_info) { + int out; + #if defined (HAVE_LINUX_SERIAL_H) && defined (TIOCGICOUNT) struct serial_icounter_struct einfo; if (!ioctl(fd, TIOCGICOUNT, &einfo)) @@ -828,8 +830,11 @@ static NTSTATUS get_irq_info(int fd, serial_irq_info *irq_info) irq_info->temt = 0; /* Generate a single TX_TXEMPTY event when the TX Buffer turns empty*/ #ifdef TIOCSERGETLSR /* prefer to log the state TIOCSERGETLSR */ - if (!ioctl(fd, TIOCSERGETLSR, &irq_info->temt)) + if (!ioctl(fd, TIOCSERGETLSR, &out)) + { + irq_info->temt = (out & TIOCSER_TEMT) != 0; return STATUS_SUCCESS; + }
TRACE("TIOCSERGETLSR err %s\n", strerror(errno)); #endif