On 2020-02-28 20:23, Corinna Vinschen wrote:

- Is it a safe bet that ClearCommError returns valid values in
   st.cbInQue even if one of the error conditions occur?  Maybe the
   right thing to do is to return 0 in certain error cases...?

The win32 api  documentation does not mention anything about not returning proper device status as long as the function succeeds...

Anyhow in my pursuit for the truth I whipped up a small test program and strace:d it (with some extra debug printout in fhandler_serial::ioctl)

 127 2403456 [main] python2.7 1662 fhandler_serial::ioctl: 0 = ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=7   216 3406481 [main] python2.7 1662 fhandler_serial::ioctl: 0 = ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=E    90 4409676 [main] python2.7 1662 fhandler_serial::ioctl: 0 = ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=15   141 5413027 [main] python2.7 1662 fhandler_serial::ioctl: 0 = ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=1C   129 6416204 [main] python2.7 1662 fhandler_serial::ioctl: 0 = ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=23   121 7419254 [main] python2.7 1662 fhandler_serial::ioctl: 0 = ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=2A   203 8423829 [main] python2.7 1662 fhandler_serial::ioctl: 0 = ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=31    89 9427183 [main] python2.7 1662 fhandler_serial::ioctl: 0 = ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=38   131 10431271 [main] python2.7 1662 fhandler_serial::ioctl: 0 = ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=3F   118 11435254 [main] python2.7 1662 fhandler_serial::ioctl: 0 = ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=46


- Did you actually try if this fixes your problem?  It's pretty
   simple to build the Cygwin DLL
   https://cygwin.com/faq.html#faq.programming.building-cygwin

I patched it yesterday and it solved the problem...

/Ake


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to