diff options
-rw-r--r-- | ext/io/console/console.c | 2 | ||||
-rw-r--r-- | io.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/io/console/console.c b/ext/io/console/console.c index 5dec1a4c06..4c5f89f80d 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -556,7 +556,7 @@ console_getch(int argc, VALUE *argv, VALUE io) if (!(w & RB_WAITFD_IN)) return Qnil; # else VALUE result = rb_io_wait(io, RUBY_IO_READABLE, timeout); - if (result == Qfalse) return Qnil; + if (!RTEST(result)) return Qnil; # endif } else if (optp->vtime) { @@ -1483,7 +1483,7 @@ rb_io_maybe_wait(int error, VALUE io, VALUE events, VALUE timeout) default: // Non-specific error, no event is ready: - return RB_INT2NUM(0); + return Qfalse; } } |