Mercurial > hg > truffle
comparison src/share/vm/compiler/compileLog.cpp @ 20679:ecccc23346fe
8007993: hotspot.log w/ enabled LogCompilation can be an invalid XML
Summary: Open compilation log files in write-mode and close before deletion attempt.
Reviewed-by: vlivanov
author | thartmann |
---|---|
date | Wed, 26 Nov 2014 08:06:58 +0100 |
parents | 78bbf4d43a14 |
children | 7848fc12602b |
comparison
equal
deleted
inserted
replaced
20678:97f4214e9a70 | 20679:ecccc23346fe |
---|---|
53 _first = this; | 53 _first = this; |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 CompileLog::~CompileLog() { | 57 CompileLog::~CompileLog() { |
58 delete _out; | 58 delete _out; // Close fd in fileStream::~fileStream() |
59 _out = NULL; | 59 _out = NULL; |
60 // Remove partial file after merging in CompileLog::finish_log_on_error | |
61 unlink(_file); | |
60 FREE_C_HEAP_ARRAY(char, _identities, mtCompiler); | 62 FREE_C_HEAP_ARRAY(char, _identities, mtCompiler); |
61 FREE_C_HEAP_ARRAY(char, _file, mtCompiler); | 63 FREE_C_HEAP_ARRAY(char, _file, mtCompiler); |
62 } | 64 } |
63 | 65 |
64 | 66 |
266 file->print_raw_cr("]]>"); | 268 file->print_raw_cr("]]>"); |
267 file->print_raw_cr("</fragment>"); | 269 file->print_raw_cr("</fragment>"); |
268 } | 270 } |
269 file->print_raw_cr("</compilation_log>"); | 271 file->print_raw_cr("</compilation_log>"); |
270 close(partial_fd); | 272 close(partial_fd); |
271 unlink(partial_file); | |
272 } | 273 } |
273 CompileLog* next_log = log->_next; | 274 CompileLog* next_log = log->_next; |
274 delete log; | 275 delete log; // Removes partial file |
275 log = next_log; | 276 log = next_log; |
276 } | 277 } |
277 _first = NULL; | 278 _first = NULL; |
278 } | 279 } |
279 | 280 |