mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-24 21:34:52 +02:00
8007993: hotspot.log w/ enabled LogCompilation can be an invalid XML
Open compilation log files in write-mode and close before deletion attempt. Reviewed-by: vlivanov
This commit is contained in:
parent
4bc2edad15
commit
137d39454d
2 changed files with 5 additions and 4 deletions
|
@ -56,8 +56,10 @@ CompileLog::CompileLog(const char* file_name, FILE* fp, intx thread_id)
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -278,10 +280,9 @@ void CompileLog::finish_log_on_error(outputStream* file, char* buf, int buflen)
|
|||
}
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue