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:
John Baldwin 2000-07-12 22:46:40 +00:00
parent 7d20010979
commit 4da144c091
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63049

View File

@ -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;