From 00cab36b36a26db2cf7ef5999faa2c9eebc22467 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 7 Jul 2021 16:14:48 -0700 Subject: [PATCH] Timeout Fix The macros setting up the timeout for the select used to timeout just multiplied the ms by 1000 to make us. The BSD select used on macOS doesn't like the us to be greater than 999999. Modified to carry the excess us over into the seconds. --- wolfssl/test.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfssl/test.h b/wolfssl/test.h index 084d88296..c9ce4c7f9 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -163,7 +163,7 @@ #define SNPRINTF snprintf #define XSELECT_WAIT(x,y) do { \ - struct timeval tv = {(x),(y)}; \ + struct timeval tv = {((x) + ((y) / 1000000)),((y) % 1000000)}; \ select(0, NULL, NULL, NULL, &tv); \ } while (0) #define XSLEEP_US(u) XSELECT_WAIT(0,u)