diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-02 03:35:40 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-06-02 03:35:40 +0000 |
commit | 2b0363df5d523434c0f197e9649713ff4bb1291b (patch) | |
tree | e7a0dcd61355a7d501af44b21f9ca942db2e99aa /io.c | |
parent | 358624d5823b100010e72ff4f6edda0c5fb6232b (diff) | |
download | ruby-2b0363df5d523434c0f197e9649713ff4bb1291b.tar.gz |
* 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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |