diff options
author | michal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-06-23 13:18:32 +0000 |
---|---|---|
committer | michal <michal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-06-23 13:18:32 +0000 |
commit | 38347d38f8a4bdedd2bbe2b2657c3d330f7d1ff5 (patch) | |
tree | 434be675d9ef1f2758e9dda3e54b2e2039e317ba | |
parent | 194902e1931ad02637083c6fb6bdae86d7fa166d (diff) | |
download | ruby-38347d38f8a4bdedd2bbe2b2657c3d330f7d1ff5.tar.gz ruby-38347d38f8a4bdedd2bbe2b2657c3d330f7d1ff5.tar.xz ruby-38347d38f8a4bdedd2bbe2b2657c3d330f7d1ff5.zip |
io_seek()'s retval should be checked [ruby-core:03045]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | io.c | 10 |
2 files changed, 12 insertions, 4 deletions
@@ -1,4 +1,8 @@ -Wed Jun 23 21:48:27 2004 Michal Rokos <michal@cvs-lang.org> +Wed Jun 23 22:16:16 2004 Michal Rokos <michal@ruby-lang.org> + + * io.c: io_seek()'s retval should be checked [ruby-core:03045] + +Wed Jun 23 21:48:27 2004 Michal Rokos <michal@ruby-lang.org> * time.c: Fix indentation. @@ -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); + } } } |