AboutSummaryRefsLogTreeCommitDiffStats
path: root/src/mcron/scripts/mcron.scm
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2018-03-20 14:44:54 +0100
committerMathieu Lirzin <mthl@gnu.org>2018-03-20 19:27:10 +0100
commitf908c5395c24da621e5e30814a7a3e4fb76abcbc (patch)
tree27746720c8c9768f63c1bf4e95ad88407fc8551b /src/mcron/scripts/mcron.scm
parent09e452b62a82845736e638eecd762a911d95a349 (diff)
downloadmcron-f908c5395c24da621e5e30814a7a3e4fb76abcbc.tar.gz
mcron-f908c5395c24da621e5e30814a7a3e4fb76abcbc.tar.bz2
mcron-f908c5395c24da621e5e30814a7a3e4fb76abcbc.zip
utils: Use 'scandir' instead of custom 'for-each-file'
* src/mcron/utils.scm (for-each-file): Delete. * src/mcron/scripts/cron.scm (process-files-in-system-directory): Use 'scandir' which has the benefit of being deterministic. * src/mcron/scripts/mcron.scm (process-files-in-user-directory): Likewise. * tests/schedule.sh: Update expected output which is now more reliable. * NEWS: Update. Suggested-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'src/mcron/scripts/mcron.scm')
-rw-r--r--src/mcron/scripts/mcron.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mcron/scripts/mcron.scm b/src/mcron/scripts/mcron.scm
index afb380f..6545ada 100644
--- a/src/mcron/scripts/mcron.scm
+++ b/src/mcron/scripts/mcron.scm
@@ -1,6 +1,6 @@
;;;; mcron -- run jobs at scheduled times
;;; Copyright © 2003, 2012 Dale Mellor <dale_mellor@users.sourceforge.net>
-;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
+;;; Copyright © 2015, 2016, 2018 Mathieu Lirzin <mthl@gnu.org>
;;;
;;; This file is part of GNU Mcron.
;;;
@@ -18,6 +18,7 @@
;;; along with GNU Mcron. If not, see <http://www.gnu.org/licenses/>.
(define-module (mcron scripts mcron)
+ #:use-module (ice-9 ftw)
#:use-module (mcron base)
#:use-module (mcron config)
#:use-module (mcron job-specifier) ;for user/system files
@@ -49,11 +50,10 @@ $XDG_CONFIG_HOME is not defined uses ~/.config/cron instead)."
(map (λ (dir)
(catch #t
(λ ()
- (for-each-file
- (λ (file)
- (process-user-file (string-append dir "/" file)
- #:input input-type))
- dir))
+ (for-each (λ (file)
+ (process-user-file (string-append dir "/" file)
+ #:input input-type))
+ (scandir dir)))
(λ (key . args)
(set! errors (1+ errors)))))
(list (string-append home-directory "/.cron")