ruby-changes:44233
From: usa <ko1@a...>
Date: Sat, 1 Oct 2016 00:55:47 +0900 (JST)
Subject: [ruby-changes:44233] usa:r56306 (ruby_2_2): merge revision(s) 56036, 56041: [Backport #12713]
usa 2016-10-01 00:55:41 +0900 (Sat, 01 Oct 2016) New Revision: 56306 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56306 Log: merge revision(s) 56036,56041: [Backport #12713] * io.c (nogvl_fsync, nogvl_fdatasync): on Windows, just ignore if the fd is associated to non-disk device. if call fsync and/or fdatasync with such fds, it causes Errno::EBADF exception and the behavior is incomatible with ruby 2.1 and earlier unintendedly introduced. incompatible with ruby 2.1 and earlier unintentionally introduced. Modified directories: branches/ruby_2_2/ Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/io.c branches/ruby_2_2/version.h Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 56305) +++ ruby_2_2/version.h (revision 56306) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.6" #define RUBY_RELEASE_DATE "2016-10-01" -#define RUBY_PATCHLEVEL 375 +#define RUBY_PATCHLEVEL 376 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 10 Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 56305) +++ ruby_2_2/ChangeLog (revision 56306) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Sat Oct 1 00:55:19 2016 NAKAMURA Usaku <usa@r...> + + * io.c (nogvl_fsync, nogvl_fdatasync): on Windows, just ignore if the + fd is associated to non-disk device. if call fsync and/or fdatasync + with such fds, it causes Errno::EBADF exception and the behavior is + incompatible with ruby 2.1 and earlier unintentionally introduced. + Sat Oct 1 00:53:28 2016 Kazuki Tsujimoto <kazuki@c...> * array.c (flatten): use rb_obj_class instead of rb_class_of Index: ruby_2_2/io.c =================================================================== --- ruby_2_2/io.c (revision 56305) +++ ruby_2_2/io.c (revision 56306) @@ -1525,6 +1525,10 @@ nogvl_fsync(void *ptr) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/io.c#L1525 { rb_io_t *fptr = ptr; +#ifdef _WIN32 + if (GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) != FILE_TYPE_DISK) + return 0; +#endif return (VALUE)fsync(fptr->fd); } #endif @@ -1926,6 +1930,10 @@ nogvl_fdatasync(void *ptr) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/io.c#L1930 { rb_io_t *fptr = ptr; +#ifdef _WIN32 + if (GetFileType((HANDLE)rb_w32_get_osfhandle(fptr->fd)) != FILE_TYPE_DISK) + return 0; +#endif return (VALUE)fdatasync(fptr->fd); } Property changes on: ruby_2_2 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r56036,56041 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/