serial_unix: Split timeout in seconds and microseconds

Macos exposed errors when tv_usec was > 1000000.
This commit is contained in:
Uwe Bonnes 2021-03-03 12:08:39 +01:00 committed by UweBonnes
parent 43770736f1
commit 3aa6f16964
1 changed files with 2 additions and 1 deletions

View File

@ -190,7 +190,8 @@ int platform_buffer_read(uint8_t *data, int maxsize)
c = data;
tv.tv_sec = 0;
tv.tv_usec = 1000 * cortexm_wait_timeout;
tv.tv_sec = cortexm_wait_timeout / 1000 ;
tv.tv_usec = 1000 * (cortexm_wait_timeout % 1000);
/* Look for start of response */
do {