guix-commits
[Top][All Lists]
Advanced

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

[shepherd] 03/07: shepherd: Don't fail if the socket file has already be


From: Ludovic Courtès
Subject: [shepherd] 03/07: shepherd: Don't fail if the socket file has already been removed.
Date: Thu, 18 Apr 2019 06:25:27 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit 352c2434a925a3e90f0593d9ad0e42b0bd82eddc
Author: Ludovic Courtès <address@hidden>
Date:   Thu Apr 18 11:39:47 2019 +0200

    shepherd: Don't fail if the socket file has already been removed.
    
    This is a followup to f260b2f90ed9ea9a1529e5a58db8df3a886d9c10.
    
    In the test suite, for example, we'd usually explicitly remove the
    socket file, possibly before 'shepherd' has exited.  This would cause a
    'system-error' exception when 'shepherd' tries to delete it.
    
    * modules/shepherd.scm (call-with-server-socket): Wrap 'delete-file'
    call in 'catch-system-error'.
---
 modules/shepherd.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/shepherd.scm b/modules/shepherd.scm
index 8b05fb5..8b2cc1d 100644
--- a/modules/shepherd.scm
+++ b/modules/shepherd.scm
@@ -58,7 +58,7 @@ socket file at FILE-NAME upon exit of PROC.  Return the 
values of PROC."
       (lambda () (proc sock))
       (lambda ()
         (close sock)
-        (delete-file file-name)))))
+        (catch-system-error (delete-file file-name))))))
 
 
 ;; Main program.



reply via email to

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