guix-commits
[Top][All Lists]
Advanced

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

[shepherd] 01/06: service: 'check-for-dead-services' uses 'catch-system-


From: Ludovic Courtès
Subject: [shepherd] 01/06: service: 'check-for-dead-services' uses 'catch-system-error'.
Date: Sat, 18 Apr 2020 11:13:44 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit 09a82355df2dea302a20a19e205460c89dd2af45
Author: Ludovic Courtès <address@hidden>
AuthorDate: Sat Apr 18 15:30:22 2020 +0200

    service: 'check-for-dead-services' uses 'catch-system-error'.
    
    * modules/shepherd/service.scm (check-for-dead-services)[process-exists?]:
    Use 'catch-system-error' instead of 'catch #t'.
---
 modules/shepherd/service.scm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 88b5c07..6d87c17 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -1274,9 +1274,8 @@ file when persistence is enabled."
 unexpectedly stopped running. This procedure is used as a fallback on systems
 where prctl/PR_SET_CHILD_SUBREAPER is unsupported."
   (define (process-exists? pid)
-    (catch #t
-      (lambda () (kill pid 0) #t)
-      (lambda _ #f)))
+    (catch-system-error (kill pid 0) #t))
+
   (for-each-service (lambda (service)
                       (let ((running (slot-ref service 'running)))
                         (when (and (integer? running)



reply via email to

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