mirror of
https://github.com/espressif/openthread.git
synced 2026-08-20 09:29:51 +00:00
[simulation] fix the wrong timeout value issue (#7262)
When the type `time_t` is 32 bits wide, the current code will truncate the value of time and returns a wrong value.
This commit is contained in:
@@ -270,7 +270,7 @@ void platformAlarmUpdateTimeout(struct timeval *aTimeout)
|
||||
remaining = 1;
|
||||
}
|
||||
|
||||
aTimeout->tv_sec = (time_t)remaining / US_PER_S;
|
||||
aTimeout->tv_sec = (time_t)(remaining / US_PER_S);
|
||||
aTimeout->tv_usec = remaining % US_PER_S;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user