Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/netbsd32 Don't do the tsleep dance if timo is 0; ...



details:   https://anonhg.NetBSD.org/src/rev/7ae76a2ea566
branches:  trunk
changeset: 554282:7ae76a2ea566
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Oct 26 19:12:50 2003 +0000

description:
Don't do the tsleep dance if timo is 0; simplify the code.

diffstat:

 sys/compat/netbsd32/netbsd32_select.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (42 lines):

diff -r 4b2ea56926f8 -r 7ae76a2ea566 sys/compat/netbsd32/netbsd32_select.c
--- a/sys/compat/netbsd32/netbsd32_select.c     Sun Oct 26 19:11:33 2003 +0000
+++ b/sys/compat/netbsd32/netbsd32_select.c     Sun Oct 26 19:12:50 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_select.c,v 1.4 2003/01/18 08:28:26 thorpej Exp $      */
+/*     $NetBSD: netbsd32_select.c,v 1.5 2003/10/26 19:12:50 christos Exp $     */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_select.c,v 1.4 2003/01/18 08:28:26 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_select.c,v 1.5 2003/10/26 19:12:50 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -111,8 +111,7 @@
                s = splclock();
                timeradd(&atv, &time, &atv);
                splx(s);
-       } else
-               timo = 0;
+       }
 retry:
        ncoll = nselcoll;
        l->l_flag |= L_SELECT;
@@ -125,9 +124,10 @@
                 * We have to recalculate the timeout on every retry.
                 */
                timo = hzto(&atv);
-               if (timo <= 0)
-                       goto done;
-       }
+       } else
+               timo = 0;
+       if (timo <= 0)
+               goto done;
        s = splhigh();
        if ((l->l_flag & L_SELECT) == 0 || nselcoll != ncoll) {
                splx(s);



Home | Main Index | Thread Index | Old Index