[4/4] ntdll: Properly set flag which indicates buffer empty state.

Dmitry Timoshkov dmitry at baikal.ru
Tue Aug 27 03:42:16 CDT 2013


---
 dlls/kernel32/tests/comm.c |  5 +----
 dlls/ntdll/serial.c        | 13 +++++--------
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/dlls/kernel32/tests/comm.c b/dlls/kernel32/tests/comm.c
index 75944e9..8600802 100644
--- a/dlls/kernel32/tests/comm.c
+++ b/dlls/kernel32/tests/comm.c
@@ -845,26 +845,23 @@ todo_wine
     res = WaitCommEvent(hcom, &evtmask, &ovl_wait);
     ok(!res && GetLastError() == ERROR_IO_PENDING, "WaitCommEvent error %d\n", GetLastError());
     res = WaitForSingleObject(ovl_wait.hEvent, TIMEOUT);
-todo_wine
     ok(res == WAIT_OBJECT_0, "WaitCommEvent failed with a timeout\n");
     if (res == WAIT_OBJECT_0)
     {
         res = GetOverlappedResult(hcom, &ovl_wait, &bytes, FALSE);
         ok(res, "GetOverlappedResult reported error %d\n", GetLastError());
+todo_wine
         ok(bytes == sizeof(evtmask), "expected %u, written %u\n", (UINT)sizeof(evtmask), bytes);
         res = TRUE;
     }
     else res = FALSE;
     after = GetTickCount();
-todo_wine
     ok(res, "WaitCommEvent error %d\n", GetLastError());
-todo_wine
     ok(evtmask & EV_TXEMPTY, "WaitCommEvent: expected EV_TXEMPTY, got %#x\n", evtmask);
     CloseHandle(ovl_wait.hEvent);
 
     timediff = after - before;
     trace("WaitCommEvent for EV_TXEMPTY took %d ms (timeout %d)\n", timediff, TIMEOUT);
-todo_wine
     ok(timediff < 900, "WaitCommEvent used %d ms for waiting\n", timediff);
 
     res = WaitForSingleObject(ovl_write.hEvent, 0);
diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c
index 7f56cb5..47b8fd8 100644
--- a/dlls/ntdll/serial.c
+++ b/dlls/ntdll/serial.c
@@ -839,16 +839,13 @@ static NTSTATUS get_irq_info(int fd, serial_irq_info *irq_info)
     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))
+    if (!ioctl(fd, TIOCOUTQ, &out))
     {
-        TRACE("TIOCOUTQ err %s\n", strerror(errno));
-        return FILE_GetNtStatus();
-    }
-    else
-    {
-        if (irq_info->temt == 0)
-            irq_info->temt = 1;
+        irq_info->temt = out == 0;
+        return STATUS_SUCCESS;
     }
+    TRACE("TIOCOUTQ err %s\n", strerror(errno));
+    return FILE_GetNtStatus();
 #endif
     return STATUS_SUCCESS;
 }
-- 
1.8.3.4




More information about the wine-patches mailing list