summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-30 07:30:45 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-04-30 07:30:45 +0000
commit98c7ca9b65be4bc102463d1c90142094e8d05c42 (patch)
tree3680753ccb4fec59ba130d4cf398afce2104c76b /io.c
parent568c934373ce149ac10afcc62d41e5f44eff56ac (diff)
* io.c (copy_stream_body, rb_io_s_copy_stream): move rb_fd_init()
from copy_stream_body to rb_io_s_copy_stream. fds of passing rb_fd_term() have to be guaranteed initialized. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index b479f33cd5..34852adcdd 100644
--- a/io.c
+++ b/io.c
@@ -8934,7 +8934,6 @@ copy_stream_body(VALUE arg)
return copy_stream_fallback(stp);
}
- rb_fd_init(&stp->fds);
rb_fd_set(src_fd, &stp->fds);
rb_fd_set(dst_fd, &stp->fds);
@@ -9013,6 +9012,7 @@ rb_io_s_copy_stream(int argc, VALUE *argv, VALUE io)
else
st.src_offset = NUM2OFFT(src_offset);
+ rb_fd_init(&st.fds);
rb_ensure(copy_stream_body, (VALUE)&st, copy_stream_finalize, (VALUE)&st);
return OFFT2NUM(st.total);