diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/socket/init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/socket/init.c b/ext/socket/init.c index bc01217641..66da534a58 100644 --- a/ext/socket/init.c +++ b/ext/socket/init.c @@ -61,7 +61,7 @@ rsock_init_sock(VALUE sock, int fd) { rb_io_t *fp; - if (!is_socket(fd)) { + if (!is_socket(fd) || rb_reserved_fd_p(fd)) { errno = EBADF; rb_sys_fail("not a socket file descriptor"); } |