From c8ed26b4ffdf12505995581f5bdcb06d1c9d0c4a Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 6 Nov 2000 22:12:17 +0000 Subject: [PATCH] A bugfix in scheduler. --- lib/silcutil/silcschedule.c | 7 +++---- lib/silcutil/silctask.c | 21 +++------------------ 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/lib/silcutil/silcschedule.c b/lib/silcutil/silcschedule.c index 5d4a8f61..b3d5a5df 100644 --- a/lib/silcutil/silcschedule.c +++ b/lib/silcutil/silcschedule.c @@ -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)) + ; } diff --git a/lib/silcutil/silctask.c b/lib/silcutil/silctask.c index 1bf8388f..9aec2507 100644 --- a/lib/silcutil/silctask.c +++ b/lib/silcutil/silctask.c @@ -17,22 +17,7 @@ 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? */ -- 2.24.0