diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-11 20:22:52 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-11 20:22:52 +0000 |
| commit | 982d734c959248e273579b09c6c7b147e8fb5d5f (patch) | |
| tree | 9c86380dc32a95254fe3063e979cc9f83f13cc50 | |
| parent | 8311b3294e4bae26af6604b507578d08468ebb56 (diff) | |
| download | ruby-982d734c959248e273579b09c6c7b147e8fb5d5f.tar.gz ruby-982d734c959248e273579b09c6c7b147e8fb5d5f.tar.xz ruby-982d734c959248e273579b09c6c7b147e8fb5d5f.zip | |
* io.c (copy_stream_fallback_body): off_t may be larger than long.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | io.c | 6 |
2 files changed, 6 insertions, 4 deletions
@@ -1,4 +1,6 @@ -Thu Mar 12 05:19:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> +Thu Mar 12 05:22:50 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * io.c (copy_stream_fallback_body): off_t may be larger than long. * iseq.c (rb_iseq_disasm): RSTRING_LEN() returns long. @@ -5448,7 +5448,7 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file) if (close(fptr->fd) < 0) rb_sys_fail_path(fptr->pathv); fptr->fd = -1; - fptr->fd = rb_sysopen(fptr->pathv, oflags, 0666); + fptr->fd = rb_sysopen(fptr->pathv, oflags, 0666); } return file; @@ -7726,7 +7726,7 @@ copy_stream_fallback_body(VALUE arg) const int buflen = 16*1024; VALUE n; VALUE buf = rb_str_buf_new(buflen); - long rest = stp->copy_length; + off_t rest = stp->copy_length; off_t off = stp->src_offset; ID read_method = id_readpartial; @@ -7745,7 +7745,7 @@ copy_stream_fallback_body(VALUE arg) else { if (rest == 0) break; - l = buflen < rest ? buflen : rest; + l = buflen < rest ? buflen : (long)rest; } if (stp->src_fd == -1) { rb_funcall(stp->src, read_method, 2, INT2FIX(l), buf); |
