mirror of
git://sigrok.org/libserialport
synced 2023-08-10 21:13:24 +03:00
windows: restart_wait_if_needed(): Skip buffer check if no bytes read.
This commit is contained in:
parent
94a314a806
commit
21ae5ce197
@ -923,6 +923,9 @@ static enum sp_return restart_wait_if_needed(struct sp_port *port, unsigned int
|
|||||||
{
|
{
|
||||||
int ret, bytes_remaining;
|
int ret, bytes_remaining;
|
||||||
|
|
||||||
|
if (bytes_read == 0)
|
||||||
|
RETURN_OK();
|
||||||
|
|
||||||
ret = sp_input_waiting(port);
|
ret = sp_input_waiting(port);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -930,7 +933,7 @@ static enum sp_return restart_wait_if_needed(struct sp_port *port, unsigned int
|
|||||||
|
|
||||||
bytes_remaining = ret;
|
bytes_remaining = ret;
|
||||||
|
|
||||||
if (bytes_read > 0 && bytes_remaining == 0)
|
if (bytes_remaining == 0)
|
||||||
TRY(restart_wait(port));
|
TRY(restart_wait(port));
|
||||||
|
|
||||||
RETURN_OK();
|
RETURN_OK();
|
||||||
|
Loading…
Reference in New Issue
Block a user