mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
527cc92793
commit
95327358ce
2 changed files with 10 additions and 5 deletions
|
@ -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.
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue