1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
nobu 2017-07-27 12:25:42 +00:00
parent 083a25f903
commit c6134d19dc

View file

@ -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));