From 6611a4be6f68e3cb15e506fb6238c5bf3cd32c60 Mon Sep 17 00:00:00 2001 From: christos Date: Fri, 7 May 2010 17:12:00 +0000 Subject: [PATCH] remove the +1 second. Otherwise jobs that are supposed to run at 10:00:00, run at 10:00:01 which is tolerable because cron has a 1 minute granularity, but confusing. This restores the old behavior with the new timing logic. --- external/bsd/cron/dist/cron.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external/bsd/cron/dist/cron.c b/external/bsd/cron/dist/cron.c index 0d0507c2ab1a..69cb274198cc 100644 --- a/external/bsd/cron/dist/cron.c +++ b/external/bsd/cron/dist/cron.c @@ -1,4 +1,4 @@ -/* $NetBSD: cron.c,v 1.4 2010/05/06 22:38:14 christos Exp $ */ +/* $NetBSD: cron.c,v 1.5 2010/05/07 17:12:00 christos Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -25,7 +25,7 @@ #if 0 static char rcsid[] = "Id: cron.c,v 1.12 2004/01/23 18:56:42 vixie Exp"; #else -__RCSID("$NetBSD: cron.c,v 1.4 2010/05/06 22:38:14 christos Exp $"); +__RCSID("$NetBSD: cron.c,v 1.5 2010/05/07 17:12:00 christos Exp $"); #endif #endif @@ -362,7 +362,7 @@ cron_sleep(int target) { int seconds_to_wait; t1 = time(NULL) + GMToff; - seconds_to_wait = (int)(target * SECONDS_PER_MINUTE - t1) + 1; + seconds_to_wait = (int)(target * SECONDS_PER_MINUTE - t1); Debug(DSCH, ("[%ld] Target time=%lld, sec-to-wait=%d\n", (long)getpid(), (long long)target*SECONDS_PER_MINUTE, seconds_to_wait));