Skip to content

Commit

Permalink
Handle usb_raw_ep_read being interrupted
Browse files Browse the repository at this point in the history
Commit 4a48d46 added a EINTR handler for usb_raw_ep_write but not
for usb_raw_ep_read; fix this.

Fixes AristoChen#25.
  • Loading branch information
xairy committed Aug 24, 2024
1 parent 4d3b90e commit 043e27a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ void *ep_loop_read(void *arg) {
ep.bEndpointAddress, transfer_type.c_str(), dir.c_str());
break;
}
if (rv < 0 && errno == EINTR) {
printf("EP%x(%s_%s): interface likely changing, stopping thread\n",
ep.bEndpointAddress, transfer_type.c_str(), dir.c_str());
break;
}
if (rv < 0) {
perror("usb_raw_ep_read()");
exit(EXIT_FAILURE);
Expand Down

0 comments on commit 043e27a

Please sign in to comment.