diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-25 07:37:34 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-25 07:37:34 +0000 |
commit | 9b651bea979f02bf7c17649dfba9015ec5244bed (patch) | |
tree | ed88017199b72254eff7ee6522f723a0db17f386 | |
parent | 8833bfbd0bd46809144199fd5d9141e60b4ec3e2 (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_3@56234 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 @@ +Sun Sep 25 16:37:22 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. + Sun Sep 25 15:09:04 2016 Kazuki Tsujimoto <kazuki@callcc.net> * array.c (flatten): use rb_obj_class instead of rb_class_of @@ -1540,6 +1540,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 @@ -1942,6 +1946,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.3.2" #define RUBY_RELEASE_DATE "2016-09-25" -#define RUBY_PATCHLEVEL 184 +#define RUBY_PATCHLEVEL 185 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 9 |