diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-29 09:01:38 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-29 09:01:38 +0000 |
commit | 95327358ce9a2c7f2c2aab68cae4446c281a655e (patch) | |
tree | 4c4f8e826b275b7cfbaa4f82e82b1a4e3a088775 /ext/io/wait | |
parent | 527cc9279367014d85f6fb96aebd301bdb3baf11 (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
Diffstat (limited to 'ext/io/wait')
-rw-r--r-- | ext/io/wait/wait.c | 11 |
1 files changed, 6 insertions, 5 deletions
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 { |