struct usb_context *ctx = data;
struct usb_functionfs_event evt;
int ret, ep0 = ctx->eps[TFMFFS_EP0];
+ ssize_t sz;
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
if (!buf)
goto err;
- if (read(ep0, buf, value) < 0) {
+ sz = read(ep0, buf, value);
+ if (sz < 0) {
free(buf);
goto err;
}
{
int buf;
- if (read(ep0, &buf, sizeof(buf)) < 0)
+ sz = read(ep0, &buf, sizeof(buf));
+ if (sz < 0)
goto err;
break;
}
default:
- if (read(ep0, NULL, 0) < 0)
+ sz = read(ep0, NULL, 0);
+ if (sz < 0)
goto err;
}
}