summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-04 05:28:50 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-04 05:28:50 +0000
commite04c3f91eb8d865d240abb0f7bacce7c188fc4ce (patch)
tree63e83ad6b21b9f45b5b1458156f273625a9301da /io.c
parent1007f138c05617e0fa701597e7ecbf883d03623a (diff)
downloadruby-e04c3f91eb8d865d240abb0f7bacce7c188fc4ce.tar.gz
ruby-e04c3f91eb8d865d240abb0f7bacce7c188fc4ce.tar.xz
ruby-e04c3f91eb8d865d240abb0f7bacce7c188fc4ce.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@4314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/io.c b/io.c
index eadaae48e..b6dfd05c9 100644
--- a/io.c
+++ b/io.c
@@ -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;