gmc-mh-1x-2x: Mark serial read calls as nonblocking.

These calls were already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. They only read one byte. A return value of zero is not
handled, but should not occur in theory due to the G_IO_IN check. It might be
good to add handling of a zero return anyway, since I'm not sure if this is
always accurate.
This commit is contained in:
Martin Ling 2014-09-21 18:36:00 +01:00 committed by Uwe Hermann
parent 0714a010cc
commit 4a0eda2b70
1 changed files with 2 additions and 2 deletions

View File

@ -1107,7 +1107,7 @@ SR_PRIV int gmc_mh_1x_2x_receive_data(int fd, int revents, void *cb_data)
if (revents == G_IO_IN) { /* Serial data arrived. */
while (GMC_BUFSIZE - devc->buflen - 1 > 0) {
len = serial_read(serial, devc->buf + devc->buflen, 1);
len = serial_read_nonblocking(serial, devc->buf + devc->buflen, 1);
if (len < 1)
break;
buf = *(devc->buf + devc->buflen);
@ -1201,7 +1201,7 @@ SR_PRIV int gmc_mh_2x_receive_data(int fd, int revents, void *cb_data)
if (revents == G_IO_IN) { /* Serial data arrived. */
while (GMC_BUFSIZE - devc->buflen - 1 > 0) {
len = serial_read(serial, devc->buf + devc->buflen, 1);
len = serial_read_nonblocking(serial, devc->buf + devc->buflen, 1);
if (len < 1)
break;
buf = *(devc->buf + devc->buflen);