1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-30 15:12:07 +00:00

AK: Make timeval_add() and timeval_sub() take references.

This commit is contained in:
Andreas Kling 2019-06-06 18:02:28 +02:00
parent bf905225e7
commit 29a9430246
4 changed files with 19 additions and 18 deletions

View file

@ -1767,8 +1767,7 @@ int Process::sys$select(const Syscall::SC_select_params* params)
return -EINVAL;
if (params->timeout && (params->timeout->tv_sec || params->timeout->tv_usec)) {
auto now = kgettimeofday();
AK::timeval_add(&now, params->timeout, &current->m_select_timeout);
timeval_add(kgettimeofday(), *params->timeout, current->m_select_timeout);
current->m_select_has_timeout = true;
} else {
current->m_select_has_timeout = false;
@ -1842,8 +1841,7 @@ int Process::sys$poll(pollfd* fds, int nfds, int timeout)
timeout -= 1000;
}
tvtimeout.tv_usec = timeout * 1000;
auto now = kgettimeofday();
AK::timeval_add(&now, &tvtimeout, &current->m_select_timeout);
timeval_add(kgettimeofday(), tvtimeout, current->m_select_timeout);
current->m_select_has_timeout = true;
} else {
current->m_select_has_timeout = false;