From: Uwe Hermann Date: Sun, 1 Dec 2013 18:30:35 +0000 (+0100) Subject: serial-dmm: No error message upon 0 new bytes. X-Git-Tag: libsigrok-0.3.0~517 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=66a435766721dd6ecdbce7b31a2f43c2e0752a12;p=libsigrok.git serial-dmm: No error message upon 0 new bytes. --- diff --git a/hardware/serial-dmm/protocol.c b/hardware/serial-dmm/protocol.c index 6ca5e73e..fab6c4ae 100644 --- a/hardware/serial-dmm/protocol.c +++ b/hardware/serial-dmm/protocol.c @@ -80,7 +80,9 @@ static void handle_new_data(struct sr_dev_inst *sdi, int dmm, void *info) /* Try to get as much data as the buffer can hold. */ len = DMM_BUFSIZE - devc->buflen; len = serial_read(serial, devc->buf + devc->buflen, len); - if (len < 1) { + if (len == 0) + return; /* No new bytes, nothing to do. */ + if (len < 0) { sr_err("Serial port read error: %d.", len); return; }