Christopher Baines skribis: > Previously the match expression case for a successful response > (where error is #f) required that the result component contained a list with a > single element. > > As far as I see when looking at the responses from the shepherd, this is not > normally the case. Therefore, to avoid treating successful responses as > errors, make the match requirement more permissive, accepting any value. > > * gnu/services/herd.scm (invoke-action): Change match condition for ok responses. > --- > gnu/services/herd.scm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gnu/services/herd.scm b/gnu/services/herd.scm > index f8d60a480..49400aba4 100644 > --- a/gnu/services/herd.scm > +++ b/gnu/services/herd.scm > @@ -146,7 +146,7 @@ result. Otherwise return #f." > (force-output sock) > > (match (read sock) > - (('reply ('version 0 _ ...) ('result (result)) ('error #f) > + (('reply ('version 0 _ ...) ('result result) ('error #f) > ('messages messages)) Actually this is not OK (it broke system tests because ‘current-services’ was now getting a single-element list instead of the list of service sexps.) The reason for this is that the ‘action’ method in the Shepherd, when invoked on a symbol, returns a list of results, one for each service of that name: (define-method (action (obj ) the-action . args) "Perform THE-ACTION on all the services named OBJ. Return the list of results." (let ((which-services (lookup-running-or-providing obj))) (if (null? which-services) (let ((unknown (lookup-running 'unknown))) (if (and unknown (defines-action? unknown 'action)) (apply action unknown 'action the-action args) (raise (condition (&missing-service-error (name obj)))))) (map (lambda (service) (apply action service the-action args)) which-services)))) (With the exception of actions called on the ‘unknown’ service, which we should probably get rid of.) So either we revert the change, or we do this: