serial-dmm: No error message upon 0 new bytes.

This commit is contained in:
Uwe Hermann 2013-12-01 19:30:35 +01:00
parent 9647ce694b
commit 66a4357667
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}