From 9e5c4cde2f219f9b37c3885a71faa05531305576 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 26 Nov 2004 04:50:36 +0000 Subject: * 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 --- io.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 99cbd1fb53..ef840e9225 100644 --- a/io.c +++ b/io.c @@ -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); -- cgit v1.2.3