guix-commits
[Top][All Lists]
Advanced

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

[shepherd] 05/08: service: Unregistering no longer leads to service dupl


From: Ludovic Courtès
Subject: [shepherd] 05/08: service: Unregistering no longer leads to service duplicates.
Date: Sat, 18 Mar 2023 18:36:37 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit 84fb3f1ddbd44d18948994bf7725d49da3f99da4
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Mar 18 18:32:28 2023 +0100

    service: Unregistering no longer leads to service duplicates.
    
    Previously, the 'unregister' procedure would register the same service
    multiple times.  For instance, ROOT-SERVICE provides 'root' and
    'shepherd', so it would appear four times in the REGISGTERED vhash
    instead of two.
    
    * modules/shepherd/service.scm (service-registry)[unregister]: Install
    just the one pair at hand instead of folding over (provided-by service).
---
 modules/shepherd/service.scm | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 0d80db3..32a4201 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -929,13 +929,11 @@ clients."
 requests arriving on @var{channel}."
   (let loop ((registered vlist-null))
     (define (unregister services)
-      ;; Return REGISTERED minus SERVICE.
+      ;; Return REGISTERED minus SERVICES.
       (vhash-fold (lambda (name service result)
                     (if (memq service services)
                         result
-                        (fold (cut vhash-consq <> service <>)
-                              result
-                              (provided-by service))))
+                        (vhash-consq name service result)))
                   vlist-null
                   registered))
 



reply via email to

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