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/base.scm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/mcron/base.scm') diff --git a/src/mcron/base.scm b/src/mcron/base.scm index 8a3f5c3..951c1d7 100644 --- a/src/mcron/base.scm +++ b/src/mcron/base.scm @@ -28,6 +28,7 @@ (define-module (mcron base) #:use-module (ice-9 match) #:use-module (mcron environment) + #:use-module (mcron utils) #:use-module (srfi srfi-1) #:use-module (srfi srfi-2) #:use-module (srfi srfi-9) @@ -85,9 +86,7 @@ This procedure is deprecated." (define* (remove-user-jobs user #:key (schedule %global-schedule)) "Remove user jobs from SCHEDULE belonging to USER. USER must be either a username, a UID, or a passwd entry." - (let ((user* (if (or (string? user) (integer? user)) - (getpw user) - user))) + (let ((user* (get-user user))) (set-schedule-user! schedule (filter (lambda (job) (not (eqv? (passwd:uid user*) -- cgit v1.2.3