diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-04 05:28:50 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-04 05:28:50 +0000 |
commit | 4aaa5493f94965fb3bbf85628f59310ff1a7a8d4 (patch) | |
tree | 63e83ad6b21b9f45b5b1458156f273625a9301da /io.c | |
parent | dd9b0df999306d9f4106eb9aaad744b42a9cddc8 (diff) |
* eval.c (method_proc): should specify YIELD_FUNC_SVALUE.
[ruby-dev:21107]
* marshal.c (w_object): should not call w_extended for USRMARSHAL
dump. [ruby-dev:21106]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -478,7 +478,7 @@ rb_io_tell(io) GetOpenFile(io, fptr); pos = io_tell(fptr); - if (ferror(fptr->f)) rb_sys_fail(fptr->path); + if (pos < 0) rb_sys_fail(fptr->path); return OFFT2NUM(pos); } @@ -492,7 +492,7 @@ rb_io_seek(io, offset, whence) GetOpenFile(io, fptr); pos = io_seek(fptr, NUM2OFFT(offset), whence); - if (pos != 0) rb_sys_fail(fptr->path); + if (pos < 0) rb_sys_fail(fptr->path); clearerr(fptr->f); return INT2FIX(0); @@ -1221,9 +1221,9 @@ rb_io_each_byte(io) TRAP_END; if (c == EOF) { if (ferror(f)) { + clearerr(f); if (!rb_io_wait_readable(fileno(f))) rb_sys_fail(fptr->path); - clearerr(f); continue; } break; @@ -1254,9 +1254,9 @@ rb_io_getc(io) if (c == EOF) { if (ferror(f)) { + clearerr(f); if (!rb_io_wait_readable(fileno(f))) rb_sys_fail(fptr->path); - clearerr(f); goto retry; } return Qnil; |