guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[shepherd] 06/07: service: Update use of long gone 'apply-to-args'.


From: Ludovic Courtès
Subject: [shepherd] 06/07: service: Update use of long gone 'apply-to-args'.
Date: Wed, 19 Sep 2018 11:44:28 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit e52ca4fb0b6e42866722256467570ad9f8de584f
Author: Ludovic Courtès <address@hidden>
Date:   Wed Sep 19 16:33:43 2018 +0200

    service: Update use of long gone 'apply-to-args'.
    
    * modules/shepherd/service.scm (handle-unknown): Use 'apply', not
    'apply-to-args'.
---
 modules/shepherd/service.scm | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index fd6ed32..8df1329 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -625,22 +625,23 @@ results."
 (define (handle-unknown . args)
   (let ((unknown (lookup-running 'unknown)))
     ;; FIXME: Display message if no unknown service.
-    (if unknown
-       (apply-to-args args
-           (case-lambda
-            ;; Start or stop.
-            ((service-symbol start/stop args)
-             (if (defines-action? unknown start/stop)
-                 (apply action unknown start/stop service-symbol args)
-               ;; FIXME: Bad message.
-               (local-output "Cannot ~a ~a." start/stop service-symbol)))
-            ;; Action.
-            ((service-symbol action-sym the-action args)
-             (assert (eq? action-sym 'action))
-             (if (defines-action? unknown 'action)
-                 (apply action unknown 'action service-symbol the-action args)
-                 (local-output (l10n "No service provides ~a.")
-                                service-symbol))))))))
+    (when unknown
+      (apply (case-lambda
+              ;; Start or stop.
+              ((service-symbol start/stop args)
+               (if (defines-action? unknown start/stop)
+                   (apply action unknown start/stop service-symbol args)
+                   ;; FIXME: Bad message.
+                   (local-output "Cannot ~a ~a." start/stop service-symbol)))
+              ;; Action.
+              ((service-symbol action-sym the-action args)
+               (assert (eq? action-sym 'action))
+               (if (defines-action? unknown 'action)
+                   (apply action unknown 'action service-symbol
+                           the-action args)
+                   (local-output (l10n "No service provides ~a.")
+                                  service-symbol))))
+             args))))
 
 ;; Check if any of SERVICES is running.  If this is the case, return
 ;; it.  If none, return `#f'.  Only the first one found will be



reply via email to

[Prev in Thread] Current Thread [Next in Thread]