summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormichal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-23 13:18:32 +0000
committermichal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-23 13:18:32 +0000
commit3e1c383e455ec9fb938e6d85b353f648d516a0de (patch)
tree434be675d9ef1f2758e9dda3e54b2e2039e317ba /io.c
parentcdf40ecbd88c9ef9f758d3bd6376668f2e4722b3 (diff)
io_seek()'s retval should be checked [ruby-core:03045]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/io.c b/io.c
index d26aaaf1cd..f066099f5d 100644
--- a/io.c
+++ b/io.c
@@ -161,7 +161,7 @@ extern int ReadDataPending();
#define READ_CHECK(fp) do {\
if (!READ_DATA_PENDING(fp)) {\
rb_thread_wait_fd(fileno(fp));\
- rb_io_check_closed(fptr);\
+ rb_io_check_closed(fptr);\
}\
} while(0)
@@ -3176,8 +3176,12 @@ io_reopen(io, nfile)
}
rb_thread_fd_close(fd);
if ((orig->mode & FMODE_READABLE) && pos >= 0) {
- io_seek(fptr, pos, SEEK_SET);
- io_seek(orig, pos, SEEK_SET);
+ if (io_seek(fptr, pos, SEEK_SET) < 0) {
+ rb_sys_fail(fptr->path);
+ }
+ if (io_seek(orig, pos, SEEK_SET) < 0) {
+ rb_sys_fail(orig->path);
+ }
}
}