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:
parent
bf905225e7
commit
29a9430246
4 changed files with 19 additions and 18 deletions
|
@ -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, ¤t->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, ¤t->m_select_timeout);
|
||||
timeval_add(kgettimeofday(), tvtimeout, current->m_select_timeout);
|
||||
current->m_select_has_timeout = true;
|
||||
} else {
|
||||
current->m_select_has_timeout = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue