From 95327358ce9a2c7f2c2aab68cae4446c281a655e Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 29 Dec 2008 09:01:38 +0000 Subject: [PATCH] * ext/io/wait/wait.c (io_ready_p): updated to follow RDoc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ ext/io/wait/wait.c | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ee11817541..9e458f3da1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Dec 29 17:52:16 2008 Yukihiro Matsumoto + + * ext/io/wait/wait.c (io_ready_p): updated to follow RDoc. + Mon Dec 29 16:52:15 2008 Yukihiro Matsumoto * ext/socket/socket.c (s_recvfrom_nonblock): revert r21162. diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c index 42f5e8fc48..24e4141162 100644 --- a/ext/io/wait/wait.c +++ b/ext/io/wait/wait.c @@ -46,7 +46,8 @@ EXTERN struct timeval rb_time_interval _((VALUE time)); * call-seq: * io.ready? -> true, false or nil * - * Returns non-nil if input available without blocking, or nil. + * Returns true if input available without blocking, or false. + * Returns nil if no information available. */ static VALUE @@ -58,10 +59,10 @@ io_ready_p(VALUE io) GetOpenFile(io, fptr); rb_io_check_readable(fptr); if (rb_io_read_pending(fptr)) return Qtrue; - if (!FIONREAD_POSSIBLE_P(fptr->fd)) return Qfalse; - if (ioctl(fptr->fd, FIONREAD, &n)) rb_sys_fail(0); - if (n > 0) return ioctl_arg2num(n); - return Qnil; + if (!FIONREAD_POSSIBLE_P(fptr->fd)) return Qnil; + if (ioctl(fptr->fd, FIONREAD, &n)) return Qnil; + if (n > 0) return Qtrue; + return Qfalse; } struct wait_readable_arg {