From 9c0ca12a2239d35fa235555729b040a320a0a65a Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Mon, 24 Aug 2009 07:52:03 -0400 Subject: [PATCH] fix handling of AFTER when no MaxWait specified Signed-off-by: Jim Pryor --- database.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/database.c b/database.c index 0c9cbc4..577b38b 100644 --- a/database.c +++ b/database.c @@ -995,9 +995,12 @@ ArmJob(CronFile *file, CronLine *line, time_t t1, time_t t2) line->cl_Pid = -2; } else { time_t t; - /* default is don't wait */ - waiter->cw_Flag = 0; - if (waiter->cw_NotifLine->cl_Freq == 0 || (waiter->cw_NotifLine->cl_Freq > 0 && t2 + waiter->cw_MaxWait <= waiter->cw_NotifLine->cl_NotUntil)) + if (waiter->cw_MaxWait == 0) + /* when no MaxWait interval specified, we always wait */ + waiter->cw_Flag = -1; + else if (waiter->cw_NotifLine->cl_Freq == 0 || (waiter->cw_NotifLine->cl_Freq > 0 && t2 + waiter->cw_MaxWait <= waiter->cw_NotifLine->cl_NotUntil)) { + /* default is don't wait */ + waiter->cw_Flag = 0; for (t = t1 - t1 % 60; t <= t2; t += 60) { if (t > t1) { struct tm *tp = localtime(&t); @@ -1020,6 +1023,7 @@ ArmJob(CronFile *file, CronLine *line, time_t t1, time_t t2) break; } } + } } } waiter = waiter->cw_Next; -- 2.11.4.GIT