Kernel: Oops, gettimeofday()'s tv_usec should be micro, not milliseconds.
This commit is contained in:
parent
a7d5e9781a
commit
ce7c302933
Notes:
sideshowbarker
2024-07-19 15:04:36 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ce7c302933b
3 changed files with 3 additions and 3 deletions
|
@ -1595,7 +1595,7 @@ int Process::sys$gettimeofday(timeval* tv)
|
|||
return -EFAULT;
|
||||
auto now = RTC::now();
|
||||
tv->tv_sec = now;
|
||||
tv->tv_usec = PIT::ticks_since_boot() % 1000;
|
||||
tv->tv_usec = (PIT::ticks_since_boot() % 1000) * 1000;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -373,7 +373,7 @@ void GEventLoop::EventLoopTimer::reload()
|
|||
{
|
||||
gettimeofday(&fire_time, nullptr);
|
||||
fire_time.tv_sec += interval / 1000;
|
||||
fire_time.tv_usec += interval % 1000;
|
||||
fire_time.tv_usec += (interval % 1000) * 1000;
|
||||
}
|
||||
|
||||
void GEventLoop::get_next_timer_expiration(timeval& soonest)
|
||||
|
|
|
@ -86,7 +86,7 @@ void WSMessageLoop::Timer::reload()
|
|||
gettimeofday(&now, nullptr);
|
||||
next_fire_time = {
|
||||
now.tv_sec + (interval / 1000),
|
||||
now.tv_usec + (interval % 1000)
|
||||
now.tv_usec + (interval % 1000) * 1000
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue