mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (io_close): always calls "close" method of the receiver.
[ruby-core:6911] [ruby-core:8112] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b0283eed43
commit
10496cefeb
2 changed files with 12 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Jul 27 17:01:01 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* io.c (io_close): always calls "close" method of the receiver.
|
||||
[ruby-core:6911] [ruby-core:8112]
|
||||
|
||||
Thu Jul 27 16:41:15 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* ext/openssl/ossl.h: move <ruby.h> inclusion point to shut up
|
||||
|
|
12
io.c
12
io.c
|
@ -2225,14 +2225,16 @@ rb_io_close_m(VALUE io)
|
|||
return Qnil;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
io_call_close(VALUE io)
|
||||
{
|
||||
return rb_funcall(io, rb_intern("close"), 0, 0);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
io_close(VALUE io)
|
||||
{
|
||||
if (TYPE(io) == T_FILE) {
|
||||
rb_io_close(io);
|
||||
return Qnil;
|
||||
}
|
||||
return rb_funcall(io, rb_intern("close"), 0, 0);
|
||||
return rb_rescue(io_call_close, io, 0, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue