AboutSummaryRefsLogTreeCommitDiffStats
path: root/src/mcron/base.scm
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2018-03-24 01:58:42 +0100
committerMathieu Lirzin <mthl@gnu.org>2018-03-24 01:58:42 +0100
commitd63db1ce4e8b30459bd3e67da619531f2741f9bf (patch)
tree6302351570437fe69d361b0e8537d1d37ca9d70a /src/mcron/base.scm
parenta1f9e3d7a765e7a057b6c2292cb0ccebe0c697d5 (diff)
downloadmcron-d63db1ce4e8b30459bd3e67da619531f2741f9bf.tar.gz
mcron-d63db1ce4e8b30459bd3e67da619531f2741f9bf.tar.bz2
mcron-d63db1ce4e8b30459bd3e67da619531f2741f9bf.zip
base: Rewrite 'child-cleanup'
* src/mcron/base.scm (child-cleanup): Use recursion instead of 'do'.
Diffstat (limited to 'src/mcron/base.scm')
-rw-r--r--src/mcron/base.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mcron/base.scm b/src/mcron/base.scm
index 951c1d7..2f1c060 100644
--- a/src/mcron/base.scm
+++ b/src/mcron/base.scm
@@ -182,13 +182,13 @@ next value."
(job:next-time-set! job ((job:next-time-function job)
(current-time))))))
-;; Give any zombie children a chance to die, and decrease the number known to
-;; exist.
-
(define (child-cleanup)
- (do () ((or (<= number-children 0)
- (eqv? (car (waitpid WAIT_ANY WNOHANG)) 0)))
- (set! number-children (- number-children 1))))
+ ;; Give any zombie children a chance to die, and decrease the number known
+ ;; to exist.
+ (unless (or (<= number-children 0)
+ (= (car (waitpid WAIT_ANY WNOHANG)) 0))
+ (set! number-children (- number-children 1))
+ (child-cleanup)))
(define* (run-job-loop #:optional fd-list #:key (schedule %global-schedule))
;; Loop over all job specifications, get a list of the next ones to run (may