AboutSummaryRefsLogTreeCommitDiffStats
path: root/job-specifier.scm
diff options
context:
space:
mode:
authordale_mellor <dale_mellor>2006-04-16 22:10:43 +0000
committerdale_mellor <dale_mellor>2006-04-16 22:10:43 +0000
commit011df9b8fd152554619f76ea1e35a68ef206762d (patch)
tree2bee99d42aa1f0e984b0af546c6f92e7aaf8416f /job-specifier.scm
parent4c3a7cc36c29ecbb8574454f0f5bdbed7ef66f8b (diff)
downloadmcron-011df9b8fd152554619f76ea1e35a68ef206762d.tar.gz
mcron-011df9b8fd152554619f76ea1e35a68ef206762d.tar.bz2
mcron-011df9b8fd152554619f76ea1e35a68ef206762d.zip
Update to 1.0.3. Lots of small changes, mainly to work with guile 1.8.0. Daylight savings time is now handled okay. Bug fix in Vixie parser. User gets option to correct bad crontab entries.1.0.3
Diffstat (limited to 'job-specifier.scm')
-rw-r--r--job-specifier.scm27
1 files changed, 19 insertions, 8 deletions
diff --git a/job-specifier.scm b/job-specifier.scm
index fd4d11b..52e655f 100644
--- a/job-specifier.scm
+++ b/job-specifier.scm
@@ -233,9 +233,10 @@
((list? action) (lambda () (primitive-eval action)))
((string? action) (lambda () (system action)))
(else
- (display "job: invalid second argument (action; should be lamdba")
- (display "function, string or list)\n")
- (primitive-exit 2))))
+ (throw 'mcron-error
+ 2
+ "job: invalid second argument (action; should be lambda"
+ " function, string or list)"))))
(time-proc
(cond ((procedure? time-proc) time-proc)
@@ -243,9 +244,10 @@
((list? time-proc) (lambda (current-time)
(primitive-eval time-proc)))
(else
- (display "job: invalid first argument (next-time-function; should ")
- (display "be function, string or list)")
- (primitive-exit 3))))
+ (throw 'mcron-error
+ 3
+ "job: invalid first argument (next-time-function; should ")
+ "be function, string or list)")))
(displayable
(cond ((not (null? displayable)) (car displayable))
((procedure? action) "Lambda function")
@@ -253,8 +255,17 @@
((list? action) (with-output-to-string
(lambda () (display action)))))))
(add-job (lambda (current-time)
- (set! current-action-time current-time) ;; ?? !!!!
- (time-proc current-time))
+ (set! current-action-time current-time) ;; ?? !!!! Code
+
+ ;; Contributed by Sergey Poznyakoff to allow for daylight savings
+ ;; time changes.
+ (let* ((next (time-proc current-time))
+ (gmtoff (tm:gmtoff (localtime next)))
+ (d (+ next (- gmtoff
+ (tm:gmtoff (localtime current-time))))))
+ (if (eqv? (tm:gmtoff (localtime d)) gmtoff)
+ d
+ next)))
action
displayable
configuration-time