Skip to content

Commit 795694c

Browse files
0xJonasrmculpepper
authored andcommitted
Allow fd zero as return value from socket
1 parent 698eade commit 795694c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

unix-socket-lib/racket/unix-socket.rkt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
;; Should be called in atomic mode.
6565
(define (do-make-socket who)
6666
(define socket-fd (socket AF-UNIX SOCK-STREAM 0))
67-
(unless (positive? socket-fd)
67+
(when (negative? socket-fd)
6868
(error who "failed to create socket~a"
6969
(errno-error-lines (saved-errno))))
7070
(set-fd-nonblocking who socket-fd)
@@ -160,7 +160,7 @@
160160
;; Non-blocking connect may succeed immediately or require waiting to see.
161161
;; - If succeeds immediately, make ports in same atomic block
162162
;; - If wait, must exit atomic mode to sync
163-
;; So we return a procedure to be applied in non-atomic mode that does
163+
;; So we return a procedure to be applied in non-atomic mode that does
164164
;; whatever needs doing.
165165
(call-as-atomic
166166
(lambda ()

0 commit comments

Comments
 (0)