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
This commit is contained in:
parent
cdf40ecbd8
commit
3e1c383e45
@ -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.
|
||||
|
||||
|
10
io.c
10
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user