X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Flib%2Fcc-usb.c;h=1e023c7ebe8f7b37e99eeef7b044d294a5f531dd;hp=1a4dc7a1163f7460bdf139422be70d72ed44d35c;hb=b67e6ae8ce34ef119da96b442776bb3d78b4f874;hpb=2b57158737f85c7009658b3e923c66794f01bbdf diff --git a/ao-tools/lib/cc-usb.c b/ao-tools/lib/cc-usb.c index 1a4dc7a1..1e023c7e 100644 --- a/ao-tools/lib/cc-usb.c +++ b/ao-tools/lib/cc-usb.c @@ -207,8 +207,10 @@ _cc_usb_sync(struct cc_usb *cc, int wait_for_input, int write_timeout) write(2, cc->in_buf, cc->in_count); cc->in_count = 0; } - } else if (ret < 0) + } else if (ret <= 0) { perror("read"); + return -1; + } } if (fds.revents & POLLOUT) { ret = write(cc->fd, cc->out_buf,