guix-commits
[Top][All Lists]
Advanced

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

[shepherd] 04/06: comm: 'open-server-socket' deletes the file before bin


From: Ludovic Courtès
Subject: [shepherd] 04/06: comm: 'open-server-socket' deletes the file before binding.
Date: Mon, 12 Jun 2023 09:39:21 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit 6d91d512551b05a430e5e2a695aa6c0fddcb0584
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Jun 11 11:29:47 2023 +0200

    comm: 'open-server-socket' deletes the file before binding.
    
    Partly fixes <https://issues.guix.gnu.org/63921>.
    
    * modules/shepherd/comm.scm (open-server-socket): Delete FILE-NAME
    before calling 'bind'.
---
 modules/shepherd/comm.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/shepherd/comm.scm b/modules/shepherd/comm.scm
index d6f259d..665124e 100644
--- a/modules/shepherd/comm.scm
+++ b/modules/shepherd/comm.scm
@@ -108,6 +108,7 @@ return the socket."
                            (logior SOCK_STREAM SOCK_NONBLOCK SOCK_CLOEXEC)
                            0))
           (address (make-socket-address AF_UNIX file-name)))
+      (catch-system-error (delete-file file-name))
       (bind sock address)
       (listen sock 10)
       sock)))



reply via email to

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