summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-25 07:37:34 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-25 07:37:34 +0000
commit9b651bea979f02bf7c17649dfba9015ec5244bed (patch)
treeed88017199b72254eff7ee6522f723a0db17f386
parent8833bfbd0bd46809144199fd5d9141e60b4ec3e2 (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--ChangeLog7
-rw-r--r--io.c8
-rw-r--r--version.h2
3 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 52dd24a6f5..377cadda36 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/io.c b/io.c
index 689d191d72..6f9896462e 100644
--- a/io.c
+++ b/io.c
@@ -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);
}
diff --git a/version.h b/version.h
index 5387687598..f56cdccccf 100644
--- a/version.h
+++ b/version.h
@@ -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