summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-27 12:25:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-07-27 12:25:42 +0000
commitc6134d19dcc2e7e4c9b46949fba1fc26616e842b (patch)
tree9af14388c0354e32aacd7f3f603862d0736ad872 /spec
parent083a25f9031401803f91156ba7687a53312c7e75 (diff)
fix type
* spec/rubyspec/optional/capi/ext/io_spec.c (io_spec_rb_io_wait_readable): fix type of read(2). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
-rw-r--r--spec/rubyspec/optional/capi/ext/io_spec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/rubyspec/optional/capi/ext/io_spec.c b/spec/rubyspec/optional/capi/ext/io_spec.c
index 9eb733b1e0..40069bd54b 100644
--- a/spec/rubyspec/optional/capi/ext/io_spec.c
+++ b/spec/rubyspec/optional/capi/ext/io_spec.c
@@ -140,7 +140,7 @@ VALUE io_spec_rb_io_taint_check(VALUE self, VALUE io) {
VALUE io_spec_rb_io_wait_readable(VALUE self, VALUE io, VALUE read_p) {
int fd = io_spec_get_fd(io);
char buf[RB_IO_WAIT_READABLE_BUF];
- int ret, r, saved_errno;
+ int ret, saved_errno;
if (set_non_blocking(fd) == -1)
rb_sys_fail("set_non_blocking failed");
@@ -157,10 +157,10 @@ VALUE io_spec_rb_io_wait_readable(VALUE self, VALUE io, VALUE read_p) {
ret = rb_io_wait_readable(fd);
if(RTEST(read_p)) {
- r = read(fd, buf, RB_IO_WAIT_READABLE_BUF);
+ ssize_t r = read(fd, buf, RB_IO_WAIT_READABLE_BUF);
if (r != RB_IO_WAIT_READABLE_BUF) {
perror("read");
- return INT2FIX(r);
+ return SSIZET2NUM(r);
}
rb_ivar_set(self, rb_intern("@read_data"),
rb_str_new(buf, RB_IO_WAIT_READABLE_BUF));