diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-30 15:55:41 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-30 15:55:41 +0000 |
commit | 6468b9bec07ae06fedfe431efca42fd38877d0c7 (patch) | |
tree | 7b6081422103f1d8c2d4983edcb4004393c84fc3 | |
parent | 4af941c708415371bf09e9ce7c695f0a55af11ae (diff) |
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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@56306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | io.c | 8 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 16 insertions, 1 deletions
@@ -1,3 +1,10 @@ +Sat Oct 1 00:55:19 2016 NAKAMURA Usaku <usa@ruby-lang.org> + + * 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@callcc.net> * array.c (flatten): use rb_obj_class instead of rb_class_of @@ -1525,6 +1525,10 @@ nogvl_fsync(void *ptr) { 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) { 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); } @@ -1,6 +1,6 @@ #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 |