civodul pushed a commit to branch master
in repository shepherd.

commit f8e0769a358c6489c3c87a7311aa31900ac5c22e
Author: Ludovic Courtès <[email protected]>
AuthorDate: Wed Sep 7 09:09:04 2022 +0200

    shepherd: Open listening socket as SOCK_NONBLOCK.
    
    * modules/shepherd.scm (open-server-socket): Pass SOCK_NONBLOCK to
    'socket'.  Remove 'fcntl' call.
---
 modules/shepherd.scm | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/modules/shepherd.scm b/modules/shepherd.scm
index 860fd30..a6a9246 100644
--- a/modules/shepherd.scm
+++ b/modules/shepherd.scm
@@ -45,11 +45,9 @@
   "Open a socket at FILE-NAME, and listen for connections there."
   (with-fluids ((%default-port-encoding "UTF-8"))
     (let ((sock    (socket PF_UNIX
-                           (logior SOCK_STREAM SOCK_CLOEXEC)
+                           (logior SOCK_STREAM SOCK_NONBLOCK SOCK_CLOEXEC)
                            0))
           (address (make-socket-address AF_UNIX file-name)))
-      (fcntl sock F_SETFL (logior O_NONBLOCK
-                                  (fcntl sock F_GETFL)))
       (bind sock address)
       (listen sock 10)
       sock)))

Reply via email to