Skip to content

Conversation

@0xJonas
Copy link
Contributor

@0xJonas 0xJonas commented Oct 17, 2025

The following code incorrectly errors:

#lang racket

(require racket/unix-socket)
(close-input-port (current-input-port))
(unix-socket-listen "socket")
$ racket test.rkt 
unix-socket-listen: failed to create socket
  errno: 2
  error: No such file or directory
  context...:
   /usr/local/share/racket/pkgs/unix-socket-lib/racket/unix-socket.rkt:226:3
   /usr/local/share/racket/collects/ffi/unsafe/atomic.rkt:73:13
   /usr/local/share/racket/collects/racket/contract/private/arrow-val-first.rkt:489:18
   body of "/home/delphy4096/src/racket-unix-socket/test.rkt"

Closing stdin makes file descriptor 0 available to be used by socket, but the check with positive? only allows return values greater than 0. This makes the function raise an error, even though there is none.

@rmculpepper rmculpepper merged commit 795694c into racket:master Oct 18, 2025
2 of 4 checks passed
@rmculpepper
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants