ruby-changes:21609
From: arton <ko1@a...>
Date: Mon, 7 Nov 2011 23:45:58 +0900 (JST)
Subject: [ruby-changes:21609] arton:r33658 (ruby_1_9_3): * io.c (io_fflush): remove fsync().
arton 2011-11-07 23:45:27 +0900 (Mon, 07 Nov 2011) New Revision: 33658 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33658 Log: * io.c (io_fflush): remove fsync(). * io.c (rb_io_flush, rb_io_rewind): fsync() here. These pathces are backports of trunk r33651 for [Bug #5585] Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/io.c Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 33657) +++ ruby_1_9_3/ChangeLog (revision 33658) @@ -1,3 +1,9 @@ +Mon Nov 7 23:39:23 2011 Tajima Akio <artonx@y...> + + * io.c (io_fflush): remove fsync(). + * io.c (rb_io_flush, rb_io_rewind): fsync() here. + These pathces are backports of trunk r33651 for [Bug #5585] + Mon Oct 10 22:33:12 2011 KOSAKI Motohiro <kosaki.motohiro@g...> * test/-ext-/old_thread_select/test_old_thread_select.rb: Index: ruby_1_9_3/io.c =================================================================== --- ruby_1_9_3/io.c (revision 33657) +++ ruby_1_9_3/io.c (revision 33658) @@ -684,11 +684,6 @@ return -1; rb_io_check_closed(fptr); } -#ifdef _WIN32 - if (GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) == FILE_TYPE_DISK) { - fsync(fptr->fd); - } -#endif return 0; } @@ -1067,6 +1062,11 @@ if (fptr->mode & FMODE_WRITABLE) { if (io_fflush(fptr) < 0) rb_sys_fail(0); +#ifdef _WIN32 + if (GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) == FILE_TYPE_DISK) { + fsync(fptr->fd); + } +#endif } if (fptr->mode & FMODE_READABLE) { io_unread(fptr); @@ -1199,6 +1199,11 @@ GetOpenFile(io, fptr); if (io_seek(fptr, 0L, 0) < 0 && errno) rb_sys_fail_path(fptr->pathv); +#ifdef _WIN32 + if (GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) == FILE_TYPE_DISK) { + fsync(fptr->fd); + } +#endif if (io == ARGF.current_file) { ARGF.lineno -= fptr->lineno; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/