diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-28 16:27:42 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-07-28 16:27:42 +0000 |
| commit | 802dc176f2be69c04b90c12b5adc9501f0affd35 (patch) | |
| tree | 6aac2cf91e05e4c74db02561fc3c059dae037139 /io.c | |
| parent | c2b153399bb69d4a74ac692b2f860e066be8a684 (diff) | |
| download | ruby-802dc176f2be69c04b90c12b5adc9501f0affd35.tar.gz ruby-802dc176f2be69c04b90c12b5adc9501f0affd35.tar.xz ruby-802dc176f2be69c04b90c12b5adc9501f0affd35.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/branches/ruby_1_8@10636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
| -rw-r--r-- | io.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -2289,16 +2289,19 @@ rb_io_close_m(io) } static VALUE -io_close(io) +io_call_close(io) 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(io) + VALUE io; +{ + return rb_rescue(io_call_close, io, 0, 0); +} + /* * call-seq: * ios.closed? => true or false |
