* io.c (io_flush, rb_io_flush): need to fsync() when ruby calls internal
flush. [ruby-core:36670] [Bug #4813] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
358624d582
commit
2b0363df5d
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jun 2 12:33:09 2011 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* io.c (io_flush, rb_io_flush): need to fsync() when ruby calls internal
|
||||||
|
flush. [ruby-core:36670] [Bug #4813]
|
||||||
|
|
||||||
Thu Jun 2 07:56:24 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
Thu Jun 2 07:56:24 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
* ext/tk/tcltklib.c: reduce CPU power required by an eventloop.
|
* ext/tk/tcltklib.c: reduce CPU power required by an eventloop.
|
||||||
|
6
io.c
6
io.c
@ -682,6 +682,9 @@ io_fflush(rb_io_t *fptr)
|
|||||||
return -1;
|
return -1;
|
||||||
rb_io_check_closed(fptr);
|
rb_io_check_closed(fptr);
|
||||||
}
|
}
|
||||||
|
#ifdef _WIN32
|
||||||
|
fsync(fptr->fd);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1054,9 +1057,6 @@ rb_io_flush(VALUE io)
|
|||||||
if (fptr->mode & FMODE_WRITABLE) {
|
if (fptr->mode & FMODE_WRITABLE) {
|
||||||
if (io_fflush(fptr) < 0)
|
if (io_fflush(fptr) < 0)
|
||||||
rb_sys_fail(0);
|
rb_sys_fail(0);
|
||||||
#ifdef _WIN32
|
|
||||||
fsync(fptr->fd);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if (fptr->mode & FMODE_READABLE) {
|
if (fptr->mode & FMODE_READABLE) {
|
||||||
io_unread(fptr);
|
io_unread(fptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user