From a1f9e3d7a765e7a057b6c2292cb0ccebe0c697d5 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Sat, 24 Mar 2018 01:33:22 +0100 Subject: utils: Add 'get-user' * src/mcron/utils.scm (get-user): New procedure. * src/mcron/job-specifier.scm (job): Use it. * src/mcron/base.scm (remove-user-jobs): Likewise. --- src/mcron/job-specifier.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mcron/job-specifier.scm') diff --git a/src/mcron/job-specifier.scm b/src/mcron/job-specifier.scm index d5bf590..5c8e171 100644 --- a/src/mcron/job-specifier.scm +++ b/src/mcron/job-specifier.scm @@ -1,6 +1,6 @@ ;;;; job-specifier.scm -- public interface for defining jobs ;;; Copyright © 2003 Dale Mellor -;;; Copyright © 2016, 2017 Mathieu Lirzin +;;; Copyright © 2016, 2017, 2018 Mathieu Lirzin ;;; ;;; This file is part of GNU Mcron. ;;; @@ -30,6 +30,7 @@ #:use-module (ice-9 match) #:use-module (mcron base) #:use-module (mcron environment) + #:use-module (mcron utils) #:use-module (mcron vixie-time) #:use-module (srfi srfi-1) #:re-export (append-environment-mods) @@ -241,9 +242,7 @@ go into the list. For example, (range 1 6 2) returns '(1 3 5)." ((procedure? action) "Lambda function") ((string? action) action) ((list? action) (simple-format #f "~A" action)))) - (user* (if (or (string? user) (integer? user)) - (getpw user) - user))) + (user* (get-user user))) (add-job (lambda (current-time) (parameterize ((%current-action-time current-time)) ;; Allow for daylight savings time changes. -- cgit v1.2.3