From 2b0363df5d523434c0f197e9649713ff4bb1291b Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 2 Jun 2011 03:35:40 +0000 Subject: * 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 --- io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 0025f86073..e8f44dcd43 100644 --- a/io.c +++ b/io.c @@ -682,6 +682,9 @@ io_fflush(rb_io_t *fptr) return -1; rb_io_check_closed(fptr); } +#ifdef _WIN32 + fsync(fptr->fd); +#endif return 0; } @@ -1054,9 +1057,6 @@ rb_io_flush(VALUE io) if (fptr->mode & FMODE_WRITABLE) { if (io_fflush(fptr) < 0) rb_sys_fail(0); -#ifdef _WIN32 - fsync(fptr->fd); -#endif } if (fptr->mode & FMODE_READABLE) { io_unread(fptr); -- cgit v1.2.3