diff options
| -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 |
