1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

fix r53231: raise Errno::EBADF like other OSes

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2015-12-22 13:45:14 +00:00
parent 96ac47c251
commit 4eac2e833c

View file

@ -61,8 +61,10 @@ rsock_init_sock(VALUE sock, int fd)
{
rb_io_t *fp;
if (!is_socket(fd))
rb_raise(rb_eArgError, "not a socket file descriptor");
if (!is_socket(fd)) {
errno = EBADF;
rb_sys_fail("not a socket file descriptor");
}
rb_update_max_fd(fd);
MakeOpenFile(sock, fp);