diff options
author | phk <phk@FreeBSD.org> | 1998-04-02 07:22:17 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-04-02 07:22:17 +0000 |
commit | f1a4c3bb6f2daa772876e55005213f04ce730329 (patch) | |
tree | fcd6ed950df3a0fe4b079f29aae48132ab268c4c | |
parent | 4b46ef5a498aeca955e386fede32482d9c17cc3b (diff) | |
download | FreeBSD-src-f1a4c3bb6f2daa772876e55005213f04ce730329.zip FreeBSD-src-f1a4c3bb6f2daa772876e55005213f04ce730329.tar.gz |
Try to fix poll & select after I broke them.
-rw-r--r-- | sys/kern/sys_generic.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index c0cb690..fb0034f 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)sys_generic.c 8.5 (Berkeley) 1/21/94 - * $Id: sys_generic.c,v 1.33 1997/11/23 10:30:50 bde Exp $ + * $Id: sys_generic.c,v 1.34 1998/03/30 09:50:29 phk Exp $ */ #include "opt_ktrace.h" @@ -600,11 +600,9 @@ select(p, uap) error = EINVAL; goto done; } - timo = tvtohz(&atv); + term = ticks + tvtohz(&atv); } else - timo = 0; - if (timo) - term = timo + ticks; + term = 0; retry: ncoll = nselcoll; p->p_flag |= P_SELECT; @@ -612,10 +610,11 @@ retry: if (error || p->p_retval[0]) goto done; s = splhigh(); - if (timo && term <= ticks) { + if (term && term <= ticks) { splx(s); goto done; } + timo = term ? term - ticks : 0; if ((p->p_flag & P_SELECT) == 0 || nselcoll != ncoll) { splx(s); goto retry; @@ -725,11 +724,9 @@ poll(p, uap) error = EINVAL; goto done; } - timo = tvtohz(&atv); + term = ticks + tvtohz(&atv); } else - timo = 0; - if (timo) - term = timo + ticks; + term = 0; retry: ncoll = nselcoll; p->p_flag |= P_SELECT; @@ -737,10 +734,11 @@ retry: if (error || p->p_retval[0]) goto done; s = splhigh(); - if (timo && term <= ticks) { + if (term && term <= ticks) { splx(s); goto done; } + timo = term ? term - ticks : 0; if ((p->p_flag & P_SELECT) == 0 || nselcoll != ncoll) { splx(s); goto retry; |