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

ruby-changes:30323

From: nagachika <ko1@a...>
Date: Sun, 4 Aug 2013 22:42:43 +0900 (JST)
Subject: [ruby-changes:30323] nagachika:r42375 (ruby_2_0_0): merge revision(s) 40001: [Backport #8109]

nagachika	2013-08-04 22:42:25 +0900 (Sun, 04 Aug 2013)

  New Revision: 42375

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42375

  Log:
    merge revision(s) 40001: [Backport #8109]
    
    * win32/win32.c (wrename): use MoveFileExW instead of MoveFileW,
      because the latter fails on cross device file move of some
      environments.
      fix [ruby-core:53492] [Bug #8109]
      reported by mitchellh (Mitchell Hashimoto)

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/version.h
    branches/ruby_2_0_0/win32/win32.c

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 42374)
+++ ruby_2_0_0/ChangeLog	(revision 42375)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sun Aug  4 22:42:16 2013  NAKAMURA Usaku  <usa@r...>
+
+	* win32/win32.c (wrename): use MoveFileExW instead of MoveFileW,
+	  because the latter fails on cross device file move of some
+	  environments.
+	  fix [ruby-core:53492] [Bug #8109]
+	  reported by mitchellh (Mitchell Hashimoto)
+
 Sat Aug  3 23:02:09 2013  Tanaka Akira  <akr@f...>
 
 	* ext/extmk.rb (extmake): Invoke Logging::log_close in a ensure
Index: ruby_2_0_0/win32/win32.c
===================================================================
--- ruby_2_0_0/win32/win32.c	(revision 42374)
+++ ruby_2_0_0/win32/win32.c	(revision 42375)
@@ -4344,18 +4344,9 @@ wrename(const WCHAR *oldpath, const WCHA https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/win32/win32.c#L4344
 	if (newatts != -1 && newatts & FILE_ATTRIBUTE_READONLY)
 	    SetFileAttributesW(newpath, newatts & ~ FILE_ATTRIBUTE_READONLY);
 
-	if (!MoveFileW(oldpath, newpath))
+	if (!MoveFileExW(oldpath, newpath, MOVEFILE_REPLACE_EXISTING | MOVEFILE_COPY_ALLOWED))
 	    res = -1;
 
-	if (res) {
-	    switch (GetLastError()) {
-	      case ERROR_ALREADY_EXISTS:
-	      case ERROR_FILE_EXISTS:
-		if (MoveFileExW(oldpath, newpath, MOVEFILE_REPLACE_EXISTING))
-		    res = 0;
-	    }
-	}
-
 	if (res)
 	    errno = map_errno(GetLastError());
 	else
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 42374)
+++ ruby_2_0_0/version.h	(revision 42375)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2013-08-04"
-#define RUBY_PATCHLEVEL 289
+#define RUBY_PATCHLEVEL 290
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 8

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r40001


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

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