diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-26 04:50:36 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-26 04:50:36 +0000 |
commit | 9e5c4cde2f219f9b37c3885a71faa05531305576 (patch) | |
tree | 6bcbb61d43f1203cd0586e4e3f72d416b6423298 /io.c | |
parent | a052ef75abbf7cc6035083a8af05cf4051ca0110 (diff) | |
download | ruby-9e5c4cde2f219f9b37c3885a71faa05531305576.tar.gz |
* io.c (rb_io_initialize): should retrieve flags from copying file
descriptor. [ruby-dev:24961]
* eval.c (method_missing): raise TypeError for classes do not
have allocators. [ruby-core:03752]
* lib/erb.rb: [ruby-core:03786]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -3971,11 +3971,13 @@ rb_io_initialize(argc, argv, io) flags = rb_io_mode_modenum(RSTRING(mode)->ptr); } } - else if (!NIL_P(orig)) { - GetOpenFile(orig, ofp); - if (ofp->refcnt == LONG_MAX) { - VALUE s = rb_inspect(orig); - rb_raise(rb_eIOError, "too many shared IO for %s", StringValuePtr(s)); + else { + if (!NIL_P(orig)) { + GetOpenFile(orig, ofp); + if (ofp->refcnt == LONG_MAX) { + VALUE s = rb_inspect(orig); + rb_raise(rb_eIOError, "too many shared IO for %s", StringValuePtr(s)); + } } #if defined(HAVE_FCNTL) && defined(F_GETFL) flags = fcntl(fd, F_GETFL); |