A bugfix in scheduler.
authorPekka Riikonen <priikone@silcnet.org>
Mon, 6 Nov 2000 22:12:17 +0000 (22:12 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 6 Nov 2000 22:12:17 +0000 (22:12 +0000)
lib/silcutil/silcschedule.c
lib/silcutil/silctask.c

index 5d4a8f612152822ea1596a5dfcd2680edfee0f2d..b3d5a5df1cb87245f4cffd07a359fff4fdff6bb7 100644 (file)
@@ -452,10 +452,8 @@ int silc_schedule_one(int timeout_usecs)
      tasks. The select() listens to these file descriptors. */
   SILC_SCHEDULE_SELECT_TASKS;
 
-  if (schedule.max_fd == -1) {
-    /*SILC_LOG_ERROR(("Nothing to listen, exiting"));*/
+  if (schedule.max_fd == -1 && !schedule.timeout)
     return FALSE;
-  }
 
   if (schedule.timeout) {
     SILC_LOG_DEBUG(("timeout: sec=%d, usec=%d", schedule.timeout->tv_sec,
@@ -511,5 +509,6 @@ void silc_schedule()
   }
 
   /* Start the scheduler loop */
-  while (silc_schedule_one(-1)) ;
+  while (silc_schedule_one(-1)) 
+    ;
 }
index 1bf8388f9ffb45ef4f26127f8dc5725adff8603c..9aec2507e5ab1ce9f6158434ed378a4538481dc9 100644 (file)
   GNU General Public License for more details.
 
 */
-/*
- * $Id$
- * $Log$
- * Revision 1.1  2000/09/13 17:45:16  priikone
- *     Splitted SILC core library. Core library includes now only
- *     SILC protocol specific stuff. New utility library includes the
- *     old stuff from core library that is more generic purpose stuff.
- *
- * Revision 1.2  2000/07/05 06:06:35  priikone
- *     Global cosmetic change.
- *
- * Revision 1.1.1.1  2000/06/27 11:36:55  priikone
- *     Imported from internal CVS/Added Log headers.
- *
- *
- */
+/* $Id$ */
 
 #include "silcincludes.h"
 
@@ -344,7 +329,7 @@ SilcTask silc_task_register(SilcTaskQueue queue, int fd,
                            SilcTaskType type, SilcTaskPriority priority)
 {
   SilcTask new;
-  int timeout = 0;
+  int timeout = FALSE;
 
   SILC_LOG_DEBUG(("Registering new task, fd=%d type=%d priority=%d", 
                  fd, type, priority));
@@ -397,7 +382,7 @@ SilcTask silc_task_register(SilcTaskQueue queue, int fd,
       new->timeout.tv_sec += 1;
       new->timeout.tv_usec -= 1000000L;
     }
-    timeout = 1;
+    timeout = TRUE;
   }
 
   /* Is this first task of the queue? */