chiark / gitweb /
Make the return type of `crc32' a `uint32' now that we have `bits.h'.
[mLib] / sel.c
diff --git a/sel.c b/sel.c
index 3f5493b8bab342458c6d52326f8750ed8e9339a8..43f95dc063d688a363ea4b90b6a2af6adea8e61c 100644 (file)
--- a/sel.c
+++ b/sel.c
@@ -1,10 +1,10 @@
 /* -*-c-*-
  *
- * $Id: sel.c,v 1.1 1999/05/14 21:01:14 mdw Exp $
+ * $Id: sel.c,v 1.3 1999/05/21 22:13:59 mdw Exp $
  *
  * I/O multiplexing support
  *
- * (c) 1999 Mark Wooding
+ * (c) 1999 Straylight/Edgeware
  */
 
 /*----- Licensing notice --------------------------------------------------* 
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: sel.c,v $
+ * Revision 1.3  1999/05/21 22:13:59  mdw
+ * Use new `tv' macros.  Fix ordering bug for timeout selectors.
+ *
+ * Revision 1.2  1999/05/15 10:33:32  mdw
+ * Fix copyright notices.
+ *
  * Revision 1.1  1999/05/14 21:01:14  mdw
  * Integrated `select' handling bits from the background resolver project.
  *
@@ -166,7 +172,7 @@ void sel_addtimer(sel_state *s, sel_timer *t,
 
   /* --- More line noise --- */
   
-  while (*tt && tv_cmp(&(*tt)->tv, tv) > 0)
+  while (*tt && TV_CMP(&(*tt)->tv, <, tv))
     tt = &(*tt)->next;
   t->next = *tt;
   t->prev = (sel_timer *)tt;
@@ -210,7 +216,7 @@ int sel_select(sel_state *s)
   if (s->timers) {
     struct timeval now;
     gettimeofday(&now, 0);
-    tv_sub(&tv, &now, &s->timers->tv);
+    TV_SUB(&tv, &s->timers->tv, &now);
     err = select(s->files ? s->files->fd + 1 : 0,
                 fd + SEL_READ, fd + SEL_WRITE, fd + SEL_EXC,
                 &tv);
@@ -225,7 +231,7 @@ int sel_select(sel_state *s)
 
   {
     sel_timer *t, *tt;
-    for (t = s->timers; t && tv_cmp(&t->tv, &tv) <= 0; t = tt) {
+    for (t = s->timers; t && TV_CMP(&t->tv, <=, &tv); t = tt) {
       tt = t->next;
       t->next = t->prev = t;
       t->func(&tv, t->p);