X-Git-Url: https://git.saurik.com/apple/ipsec.git/blobdiff_plain/52b7d2ce06d68d0a9160d16f6e7c08c21c149d0d..e97d2cf9e57aa916003425bfe70d778860032d0f:/ipsec-tools/racoon/schedule.c diff --git a/ipsec-tools/racoon/schedule.c b/ipsec-tools/racoon/schedule.c index 705f4ce..fe82c30 100644 --- a/ipsec-tools/racoon/schedule.c +++ b/ipsec-tools/racoon/schedule.c @@ -1,3 +1,5 @@ +/* $NetBSD: schedule.c,v 1.4 2006/09/09 16:22:10 manu Exp $ */ + /* $KAME: schedule.c,v 1.19 2001/11/05 10:53:19 sakane Exp $ */ /* @@ -49,13 +51,17 @@ #include "var.h" #include "gcmalloc.h" +#if !defined(__LP64__) +// year 2038 problem and fix for 32-bit only #define FIXY2038PROBLEM +#endif #ifndef TAILQ_FOREACH #define TAILQ_FOREACH(elm, head, field) \ for (elm = TAILQ_FIRST(head); elm; elm = TAILQ_NEXT(elm, field)) #endif +extern int terminated; static struct timeval timeout; #ifdef FIXY2038PROBLEM @@ -83,7 +89,7 @@ schedular() now = current_time(); - for (p = TAILQ_FIRST(&sctree); p; p = next) { + for (p = TAILQ_FIRST(&sctree); p; p = next) { /* if the entry has been dead, remove it */ if (p->dead) goto next_schedule; @@ -96,7 +102,7 @@ schedular() /* mark it with dead. and call the function. */ p->dead = 1; - if (p->func != NULL) + if (p->func != NULL && !terminated) (p->func)(p->param); next_schedule: @@ -308,7 +314,7 @@ getstdin() struct scheddump *scbuf, *p; int len; sched_dump((caddr_t *)&scbuf, &len); - if (buf == NULL) + if (scbuf == NULL) return; for (p = scbuf; len; p++) { printf("xtime=%ld\n", p->xtime);