AboutSummaryRefsLogTreeCommitDiffStats
path: root/mcron-core.scm
diff options
context:
space:
mode:
authordale_mellor <dale_mellor>2005-10-23 12:29:19 +0000
committerdale_mellor <dale_mellor>2005-10-23 12:29:19 +0000
commitb1e921ffc81d460ef0ed7ab6163eb38b654ddf3b (patch)
tree4d5a51b409075d5c1617b7cab96a3b863d0b4f2a /mcron-core.scm
parent863b755293610f84bc0f871264195076f99a9392 (diff)
downloadmcron-b1e921ffc81d460ef0ed7ab6163eb38b654ddf3b.tar.gz
mcron-b1e921ffc81d460ef0ed7ab6163eb38b654ddf3b.tar.bz2
mcron-b1e921ffc81d460ef0ed7ab6163eb38b654ddf3b.zip
Changes requested by David D. Smith.1.0.2.rc1
Non-root install.
Diffstat (limited to 'mcron-core.scm')
-rw-r--r--mcron-core.scm44
1 files changed, 22 insertions, 22 deletions
diff --git a/mcron-core.scm b/mcron-core.scm
index 0aaacc6..631311a 100644
--- a/mcron-core.scm
+++ b/mcron-core.scm
@@ -70,8 +70,6 @@
(define (job:environment job) (vector-ref job 3))
(define (job:displayable job) (vector-ref job 4))
(define (job:next-time job) (vector-ref job 5))
-(define (job:advance-time! job)
- (vector-set! job 5 ((job:next-time-function job) (job:next-time job))))
@@ -99,21 +97,15 @@
(define (add-job time-proc action displayable configuration-time
configuration-user)
- (if (eq? configuration-source 'user)
- (set! user-job-list (cons (vector configuration-user
- time-proc
- action
- (get-current-environment-mods-copy)
- displayable
- (time-proc configuration-time))
- user-job-list))
- (set! system-job-list (cons (vector configuration-user
- time-proc
- action
- (get-current-environment-mods-copy)
- displayable
- (time-proc configuration-time))
- system-job-list))))
+ (let ((entry (vector configuration-user
+ time-proc
+ action
+ (get-current-environment-mods-copy)
+ displayable
+ (time-proc configuration-time))))
+ (if (eq? configuration-source 'user)
+ (set! user-job-list (cons entry user-job-list))
+ (set! system-job-list (cons entry system-job-list)))))
@@ -176,10 +168,14 @@
(and-let* ((next-jobs (find-next-jobs))
(time (car next-jobs))
(date-string (strftime "%c\n" (localtime time))))
- (for-each (lambda (job) (display date-string)
- (display (job:displayable job))
- (newline)(newline)
- (job:advance-time! job))
+ (for-each (lambda (job)
+ (display date-string)
+ (display (job:displayable job))
+ (newline)(newline)
+ (vector-set! job
+ 5
+ ((job:next-time-function job)
+ (job:next-time job))))
(cdr next-jobs)))))))
@@ -202,6 +198,7 @@
(for-each (lambda (job)
(if (eqv? (primitive-fork) 0)
(begin
+ (setgid (passwd:gid (job:user job)))
(setuid (passwd:uid (job:user job)))
(chdir (passwd:dir (job:user job)))
(modify-environment (job:environment job) (job:user job))
@@ -209,7 +206,10 @@
(primitive-exit 0))
(begin
(set! number-children (+ number-children 1))
- (job:advance-time! job))))
+ (vector-set! job
+ 5
+ ((job:next-time-function job)
+ (current-time))))))
jobs-list))