[前][次][番号順一覧][スレッド一覧]

ruby-changes:19351

From: kosaki <ko1@a...>
Date: Sat, 30 Apr 2011 16:36:06 +0900 (JST)
Subject: [ruby-changes:19351] Ruby:r31391 (trunk): * io.c (copy_stream_body, rb_io_s_copy_stream): move rb_fd_init()

kosaki	2011-04-30 16:30:45 +0900 (Sat, 30 Apr 2011)

  New Revision: 31391

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31391

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31390)
+++ ChangeLog	(revision 31391)
@@ -1,3 +1,9 @@
+Sat Apr 30 16:27:09 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* 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@g...>
 
 	* benchmark/bm_io_select.rb, benchmark/bm_io_select2.rb: New.
Index: io.c
===================================================================
--- io.c	(revision 31390)
+++ io.c	(revision 31391)
@@ -8934,7 +8934,6 @@
         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 @@
     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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]