mirror of
https://github.com/ckb-next/ckb-next.git
synced 2026-10-29 12:37:48 -04:00
Don't wait on kIOReturnNoResources
This commit is contained in:
1 file changed
+1
-1
@@ -75,7 +75,7 @@ static void usbgetstr(usb_dev_t handle, uint8 string_index, char* output, int ou
|
||||
// Hacky way of trying something over and over again until it works. 100ms intervals, max 1s
|
||||
#define wait_loop(error, operation) do { \
|
||||
int trial = 0; \
|
||||
while(((error) = (operation)) != kIOReturnSuccess){ \
|
||||
while(((error) = (operation)) != kIOReturnSuccess && ((error) = (operation)) != kIOReturnNoResources){ \
|
||||
if(++trial == 10) \
|
||||
break; \
|
||||
clock_nanosleep(CLOCK_MONOTONIC, 0, &(struct timespec) {.tv_nsec = 100000000}, NULL); \
|
||||
|
||||
Reference in new issue
Block a user