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.
This commit is contained in:
John Safranek
2021-07-07 16:14:48 -07:00
parent 86e5287a14
commit 00cab36b36

View File

@ -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)