summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-02 03:35:40 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-02 03:35:40 +0000
commit2b0363df5d523434c0f197e9649713ff4bb1291b (patch)
treee7a0dcd61355a7d501af44b21f9ca942db2e99aa /io.c
parent358624d5823b100010e72ff4f6edda0c5fb6232b (diff)
* 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
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 3 insertions, 3 deletions
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);