1
0
mirror of git://sigrok.org/libserialport synced 2023-08-10 21:13:24 +03:00

Check return value of GetOverlappedResult().

This commit is contained in:
Martin Ling 2013-12-07 16:50:27 +00:00
parent 7c1eff54fd
commit 1622ef60b0

View File

@ -1155,7 +1155,8 @@ enum sp_return sp_nonblocking_read(struct sp_port *port, void *buf, size_t count
RETURN_FAIL("ReadFile() failed"); RETURN_FAIL("ReadFile() failed");
/* Get number of bytes read. */ /* Get number of bytes read. */
GetOverlappedResult(port->hdl, &port->read_ovl, &bytes_read, TRUE); if (GetOverlappedResult(port->hdl, &port->read_ovl, &bytes_read, TRUE) == 0)
RETURN_FAIL("GetOverlappedResult() failed");
RETURN_VALUE("%d", bytes_read); RETURN_VALUE("%d", bytes_read);
#else #else