mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
Fix a very obscure bug in select() and poll() where the timeout would
never expire if poll() or select() was called before the system had been in multiuser for 1 second. This was caused by only checking to see if tv_sec was zero rather than checking both tv_sec and tv_usec.
This commit is contained in:
parent
7d20010979
commit
4da144c091
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63049
@ -703,7 +703,7 @@ retry:
|
||||
error = selscan(p, ibits, obits, uap->nd);
|
||||
if (error || p->p_retval[0])
|
||||
goto done;
|
||||
if (atv.tv_sec) {
|
||||
if (atv.tv_sec || atv.tv_usec) {
|
||||
getmicrouptime(&rtv);
|
||||
if (timevalcmp(&rtv, &atv, >=))
|
||||
goto done;
|
||||
@ -836,7 +836,7 @@ retry:
|
||||
error = pollscan(p, (struct pollfd *)bits, SCARG(uap, nfds));
|
||||
if (error || p->p_retval[0])
|
||||
goto done;
|
||||
if (atv.tv_sec) {
|
||||
if (atv.tv_sec || atv.tv_usec) {
|
||||
getmicrouptime(&rtv);
|
||||
if (timevalcmp(&rtv, &atv, >=))
|
||||
goto done;
|
||||
|
Loading…
Reference in New Issue
Block a user