summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-29 09:01:38 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-29 09:01:38 +0000
commit95327358ce9a2c7f2c2aab68cae4446c281a655e (patch)
tree4c4f8e826b275b7cfbaa4f82e82b1a4e3a088775
parent527cc9279367014d85f6fb96aebd301bdb3baf11 (diff)
* 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
-rw-r--r--ChangeLog4
-rw-r--r--ext/io/wait/wait.c11
2 files changed, 10 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index ee118175419..9e458f3da1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Dec 29 17:52:16 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * ext/io/wait/wait.c (io_ready_p): updated to follow RDoc.
+
Mon Dec 29 16:52:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/socket/socket.c (s_recvfrom_nonblock): revert r21162.
diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c
index 42f5e8fc480..24e4141162e 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 {