1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-18 04:58:51 +02:00

Fix cast for timeval.tv_usec.

Found testing on MacOS M1.
This commit is contained in:
David Steele 2021-01-21 17:20:13 -05:00
parent 6f529155b6
commit 4b3200961e
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ sleepMSec(TimeMSec sleepMSec)
struct timeval delay;
delay.tv_sec = (time_t)(sleepMSec / MSEC_PER_SEC);
delay.tv_usec = (time_t)(sleepMSec % MSEC_PER_SEC * 1000);
delay.tv_usec = (suseconds_t)(sleepMSec % MSEC_PER_SEC * 1000);
select(0, NULL, NULL, NULL, &delay);
FUNCTION_TEST_RETURN_VOID();

View File

@ -146,7 +146,7 @@ protocolParallelProcess(ProtocolParallel *this)
// Initialize timeout struct used for select. Recreate this structure each time since Linux (at least) will modify it.
struct timeval timeoutSelect;
timeoutSelect.tv_sec = (time_t)(this->timeout / MSEC_PER_SEC);
timeoutSelect.tv_usec = (time_t)(this->timeout % MSEC_PER_SEC * 1000);
timeoutSelect.tv_usec = (suseconds_t)(this->timeout % MSEC_PER_SEC * 1000);
// Determine if there is data to be read
int completed = select(fdMax + 1, &selectSet, NULL, NULL, &timeoutSelect);