mirror of
https://github.com/ep00ch/lwip-contrib-mac.git
synced 2024-06-12 01:29:28 +00:00
sys_jiffies(): set sec and usec correctly from gettimeofday(), and avoid sec overflow
This commit is contained in:
parent
6de783946f
commit
579c7a3df4
|
@ -587,10 +587,12 @@ unsigned long
|
|||
sys_jiffies(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
unsigned long sec = tv.tv_sec;
|
||||
long usec = tv.tv_usec;
|
||||
unsigned long sec;
|
||||
long usec;
|
||||
|
||||
gettimeofday(&tv,NULL);
|
||||
sec = tv.tv_sec - starttime.tv_sec;
|
||||
usec = tv.tv_usec;
|
||||
|
||||
if (sec >= (MAX_JIFFY_OFFSET / HZ))
|
||||
return MAX_JIFFY_OFFSET;
|
||||
|
|
Loading…
Reference in New Issue
Block a user