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

ruby-changes:10950

From: akr <ko1@a...>
Date: Sun, 22 Feb 2009 19:28:49 +0900 (JST)
Subject: [ruby-changes:10950] Ruby:r22526 (trunk): * ext/socket/init.c (s_recvfrom): use rb_io_wait_readable after

akr	2009-02-22 19:28:38 +0900 (Sun, 22 Feb 2009)

  New Revision: 22526

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

  Log:
    * ext/socket/init.c (s_recvfrom): use rb_io_wait_readable after
      recvfrom.

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/init.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 22525)
+++ ChangeLog	(revision 22526)
@@ -1,3 +1,8 @@
+Sun Feb 22 19:28:08 2009  Tanaka Akira  <akr@f...>
+
+	* ext/socket/init.c (s_recvfrom): use rb_io_wait_readable after
+	  recvfrom.
+
 Sun Feb 22 18:40:04 2009  Tanaka Akira  <akr@f...>
 
 	* ext/socket/option.c (inspect_errno): new function.
Index: ext/socket/init.c
===================================================================
--- ext/socket/init.c	(revision 22525)
+++ ext/socket/init.c	(revision 22526)
@@ -119,6 +119,9 @@
     while (rb_io_check_closed(fptr),
 	   rb_thread_wait_fd(arg.fd),
 	   (slen = BLOCKING_REGION(recvfrom_blocking, &arg)) < 0) {
+        if (!rb_io_wait_readable(fptr->fd)) {
+            rb_sys_fail("recvfrom(2)");
+        }
 	if (RBASIC(str)->klass || RSTRING_LEN(str) != buflen) {
 	    rb_raise(rb_eRuntimeError, "buffer string modified");
 	}

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

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