Преглед изворни кода

Mon Jan 29 16:51:33 CET 2007 Paolo Molaro <[email protected]>

	* MonoSymbolWriter.cs: unlink the file before writing it, since it may
	be mmapped by the runtime.


svn path=/trunk/mcs/; revision=71892
Paolo Molaro пре 19 година
родитељ
комит
f593ee900b

+ 6 - 0
mcs/class/Mono.CompilerServices.SymbolWriter/ChangeLog

@@ -1,3 +1,9 @@
+
+Mon Jan 29 16:51:33 CET 2007 Paolo Molaro <[email protected]>
+
+	* MonoSymbolWriter.cs: unlink the file before writing it, since it may
+	be mmapped by the runtime.
+
 2007-01-29  Martin Baulig  <[email protected]>
 
 	* MonoSymbolFile.cs

+ 6 - 0
mcs/class/Mono.CompilerServices.SymbolWriter/MonoSymbolWriter.cs

@@ -181,6 +181,12 @@ namespace Mono.CompilerServices.SymbolWriter
 					method.Method.NamespaceID);
 			}
 
+			try {
+				// We mmap the file, so unlink the previous version since it may be in use
+				File.Delete (filename);
+			} catch {
+				// We can safely ignore
+			}
 			using (FileStream fs = new FileStream (filename, FileMode.Create, FileAccess.Write)) {
 				file.CreateSymbolFile (guid, fs);
 			}