From 22cef963c31c575dd08b3e7af372f69772372988 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 22 Feb 2009 10:28:38 +0000 Subject: [PATCH] * ext/socket/init.c (s_recvfrom): use rb_io_wait_readable after recvfrom. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/socket/init.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1dedb7e019..872fb12247 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Feb 22 19:28:08 2009 Tanaka Akira + + * ext/socket/init.c (s_recvfrom): use rb_io_wait_readable after + recvfrom. + Sun Feb 22 18:40:04 2009 Tanaka Akira * ext/socket/option.c (inspect_errno): new function. diff --git a/ext/socket/init.c b/ext/socket/init.c index 908268c40c..8958db7562 100644 --- a/ext/socket/init.c +++ b/ext/socket/init.c @@ -119,6 +119,9 @@ s_recvfrom(VALUE sock, int argc, VALUE *argv, enum sock_recv_type from) 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"); }