mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (rb_io_reopen): flush before reopening a file.
reported by Mathieu Bouchard. [ruby-core:7396] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
04946de81b
commit
2b2910c713
2 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Feb 20 18:21:41 2006 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
|
* io.c (rb_io_reopen): flush before reopening a file.
|
||||||
|
reported by Mathieu Bouchard. [ruby-core:7396]
|
||||||
|
|
||||||
Mon Feb 20 17:29:50 2006 Tanaka Akira <akr@m17n.org>
|
Mon Feb 20 17:29:50 2006 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
* mkconfig.rb: generate RbConfig instead of Config.
|
* mkconfig.rb: generate RbConfig instead of Config.
|
||||||
|
|
4
io.c
4
io.c
|
@ -3416,6 +3416,10 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fptr->mode & FMODE_WRITABLE) {
|
||||||
|
io_fflush(fptr);
|
||||||
|
}
|
||||||
|
|
||||||
if (fptr->stdio_file) {
|
if (fptr->stdio_file) {
|
||||||
if (freopen(RSTRING(fname)->ptr, mode, fptr->stdio_file) == 0) {
|
if (freopen(RSTRING(fname)->ptr, mode, fptr->stdio_file) == 0) {
|
||||||
rb_sys_fail(fptr->path);
|
rb_sys_fail(fptr->path);
|
||||||
|
|
Loading…
Add table
Reference in a new issue