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 178aad0948..4d7cf29ea3 100644 --- a/ext/socket/init.c +++ b/ext/socket/init.c @@ -58,7 +58,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"); } |