Skip to content

Commit

Permalink
tests/stress_mt: Stop early if any device fails
Browse files Browse the repository at this point in the history
Previously the loop would continue even if error has already occured
since `goto close` alone doesn't stop early.

References libusb#1360
  • Loading branch information
RReverser authored and tormodvolden committed Dec 12, 2023
1 parent ebfbf19 commit 87d6686
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libusb/version_nano.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define LIBUSB_NANO 11849
#define LIBUSB_NANO 11850
2 changes: 1 addition & 1 deletion tests/stress_mt.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static thread_return_t THREAD_CALL_TYPE init_and_exit(void * arg)
ti->err = (int)ti->devcount;
break;
}
for (int i = 0; i < ti->devcount; i++) {
for (int i = 0; i < ti->devcount && ti->err == 0; i++) {
libusb_device *dev = devs[i];
struct libusb_device_descriptor desc;
if ((ti->err = libusb_get_device_descriptor(dev, &desc)) != 0) {
Expand Down

0 comments on commit 87d6686

Please sign in to comment.