[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
- [shepherd] branch master updated (0c4d8ec -> e390a78), Ludovic Courtès, 2018/09/19
- [shepherd] 01/07: Remove EINTR-safe, and all references to it., Ludovic Courtès, 2018/09/19
- [shepherd] 04/07: comm: Do not introduce empty lines in the log., Ludovic Courtès, 2018/09/19
- [shepherd] 03/07: i18n: Add missing calls to 'l10n'., Ludovic Courtès, 2018/09/19
- [shepherd] 06/07: service: Update use of long gone 'apply-to-args'.,
Ludovic Courtès <=
- [shepherd] 02/07: Make sure ctrl-alt-del is handled by PID 1., Ludovic Courtès, 2018/09/19
- [shepherd] 05/07: Remove runlevels., Ludovic Courtès, 2018/09/19
- [shepherd] 07/07: nls: Add sv translation., Ludovic Courtès, 2018/09/19