Mercurial > hg > graal-jvmci-8
comparison src/share/vm/compiler/compileBroker.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 | 28051f14c328 |
children | 7848fc12602b |
comparison
equal
deleted
inserted
replaced
20678:97f4214e9a70 | 20679:ecccc23346fe |
---|---|
1843 jio_snprintf(file_name, sizeof(file_name), | 1843 jio_snprintf(file_name, sizeof(file_name), |
1844 "%s%shs_c" UINTX_FORMAT "_pid%u.log", dir, | 1844 "%s%shs_c" UINTX_FORMAT "_pid%u.log", dir, |
1845 os::file_separator(), thread_id, os::current_process_id()); | 1845 os::file_separator(), thread_id, os::current_process_id()); |
1846 } | 1846 } |
1847 | 1847 |
1848 fp = fopen(file_name, "at"); | 1848 fp = fopen(file_name, "wt"); |
1849 if (fp != NULL) { | 1849 if (fp != NULL) { |
1850 if (LogCompilation && Verbose) { | 1850 if (LogCompilation && Verbose) { |
1851 tty->print_cr("Opening compilation log %s", file_name); | 1851 tty->print_cr("Opening compilation log %s", file_name); |
1852 } | 1852 } |
1853 CompileLog* log = new(ResourceObj::C_HEAP, mtCompiler) CompileLog(file_name, fp, thread_id); | 1853 CompileLog* log = new(ResourceObj::C_HEAP, mtCompiler) CompileLog(file_name, fp, thread_id); |