diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-27 08:25:18 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-27 08:25:18 +0000 |
| commit | 827ebbef52bc064200a12e5cfdf6cf8c211cd98c (patch) | |
| tree | 0b61a80ac0be119b213e99c746077c0077e4fcf5 | |
| parent | c55719227f0a037e9056e64225a8f209774287e4 (diff) | |
| download | ruby-827ebbef52bc064200a12e5cfdf6cf8c211cd98c.tar.gz ruby-827ebbef52bc064200a12e5cfdf6cf8c211cd98c.tar.xz ruby-827ebbef52bc064200a12e5cfdf6cf8c211cd98c.zip | |
* io.c (io_close): always calls "close" method of the receiver.
[ruby-core:6911] [ruby-core:8112]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | io.c | 12 |
2 files changed, 12 insertions, 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 @@ -2226,15 +2226,17 @@ rb_io_close_m(VALUE io) } static VALUE -io_close(VALUE io) +io_call_close(VALUE io) { - if (TYPE(io) == T_FILE) { - rb_io_close(io); - return Qnil; - } return rb_funcall(io, rb_intern("close"), 0, 0); } +static VALUE +io_close(VALUE io) +{ + return rb_rescue(io_call_close, io, 0, 0); +} + /* * call-seq: * ios.closed? => true or false |
