summaryrefslogtreecommitdiff
path: root/ao-tools/lib/cc-usb.c
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2015-07-16 13:36:59 -0600
committerBdale Garbee <bdale@gag.com>2015-07-16 13:36:59 -0600
commitf4f0f044df1251d64d44bf62d25b488fd04a05c8 (patch)
tree12efee1447a67d8cf37b6f447c011708264b8266 /ao-tools/lib/cc-usb.c
parentb25690062ac04a588ad4d11740597c20e516eb1a (diff)
parent570daace9caf7647a09c53d5c75593cc4c98b93b (diff)
Merge branch 'branch-1.6' into debian
Diffstat (limited to 'ao-tools/lib/cc-usb.c')
-rw-r--r--ao-tools/lib/cc-usb.c4
1 files changed, 3 insertions, 1 deletions
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,