[前][次][番号順一覧][スレッド一覧]

ruby-changes:44161

From: nagachika <ko1@a...>
Date: Sun, 25 Sep 2016 16:37:39 +0900 (JST)
Subject: [ruby-changes:44161] nagachika:r56234 (ruby_2_3): merge revision(s) 56036, 56041: [Backport #12713]

nagachika	2016-09-25 16:37:34 +0900 (Sun, 25 Sep 2016)

  New Revision: 56234

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56234

  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_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/io.c
    branches/ruby_2_3/version.h
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 56233)
+++ ruby_2_3/ChangeLog	(revision 56234)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Sun Sep 25 16:37:22 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.
+
 Sun Sep 25 15:09:04 2016  Kazuki Tsujimoto  <kazuki@c...>
 
 	* array.c (flatten): use rb_obj_class instead of rb_class_of
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 56233)
+++ ruby_2_3/version.h	(revision 56234)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #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
Index: ruby_2_3/io.c
===================================================================
--- ruby_2_3/io.c	(revision 56233)
+++ ruby_2_3/io.c	(revision 56234)
@@ -1540,6 +1540,10 @@ nogvl_fsync(void *ptr) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/io.c#L1540
 {
     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) https://github.com/ruby/ruby/blob/trunk/ruby_2_3/io.c#L1946
 {
     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_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r56036,56041


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]