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:
parent
96ac47c251
commit
4eac2e833c
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue