summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--io.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index bc17856b23..9c2c61022e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Apr 30 16:27:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * 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.
+
Sat Apr 30 16:13:17 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* benchmark/bm_io_select.rb, benchmark/bm_io_select2.rb: New.
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);