[2/4] ntdll: Fallback to ioctl(TIOCOUTQ) if ioctl(TIOCSERGETLSR) fails.

Dmitry Timoshkov dmitry at baikal.ru
Tue Aug 27 03:40:17 CDT 2013


Most of Linux USB-serial drivers don't support TIOCSERGETLSR.
---
 dlls/ntdll/serial.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c
index 91e7230..bb025cf 100644
--- a/dlls/ntdll/serial.c
+++ b/dlls/ntdll/serial.c
@@ -828,12 +828,12 @@ 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))
-    {
-        TRACE("TIOCSERGETLSR err %s\n", strerror(errno));
-        return FILE_GetNtStatus();
-    }
-#elif defined(TIOCOUTQ)  /* otherwise we log when the out queue gets empty */
+    if (!ioctl(fd, TIOCSERGETLSR, &irq_info->temt))
+        return STATUS_SUCCESS;
+
+    TRACE("TIOCSERGETLSR err %s\n", strerror(errno));
+#endif
+#ifdef TIOCOUTQ  /* otherwise we log when the out queue gets empty */
     if (ioctl(fd, TIOCOUTQ, &irq_info->temt))
     {
         TRACE("TIOCOUTQ err %s\n", strerror(errno));
-- 
1.8.3.4




More information about the wine-patches mailing list