changeset 20682:b12418b0d05c

Merge
author roland
date Tue, 02 Dec 2014 10:43:43 +0000
parents ecccc23346fe (diff) 4c228230f1d6 (current diff)
children abb8b1de96ff c03d85ef5e6a
files
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/compiler/compileBroker.cpp	Thu Nov 27 16:54:49 2014 +0100
+++ b/src/share/vm/compiler/compileBroker.cpp	Tue Dec 02 10:43:43 2014 +0000
@@ -1845,7 +1845,7 @@
                      os::file_separator(), thread_id, os::current_process_id());
       }
 
-      fp = fopen(file_name, "at");
+      fp = fopen(file_name, "wt");
       if (fp != NULL) {
         if (LogCompilation && Verbose) {
           tty->print_cr("Opening compilation log %s", file_name);
--- a/src/share/vm/compiler/compileLog.cpp	Thu Nov 27 16:54:49 2014 +0100
+++ b/src/share/vm/compiler/compileLog.cpp	Tue Dec 02 10:43:43 2014 +0000
@@ -55,8 +55,10 @@
 }
 
 CompileLog::~CompileLog() {
-  delete _out;
+  delete _out; // Close fd in fileStream::~fileStream()
   _out = NULL;
+  // Remove partial file after merging in CompileLog::finish_log_on_error
+  unlink(_file);
   FREE_C_HEAP_ARRAY(char, _identities, mtCompiler);
   FREE_C_HEAP_ARRAY(char, _file, mtCompiler);
 }
@@ -268,10 +270,9 @@
       }
       file->print_raw_cr("</compilation_log>");
       close(partial_fd);
-      unlink(partial_file);
     }
     CompileLog* next_log = log->_next;
-    delete log;
+    delete log; // Removes partial file
     log = next_log;
   }
   _first = NULL;