mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 13:54:38 +02:00
6938627: Make temporary directory use property java.io.tmpdir when specified
Get java.io.tmpdir property in os::get_temp_directory() and call this instead of harcoding "/tmp". Don't assume trailing file_separator either. Reviewed-by: dholmes, kamg
This commit is contained in:
parent
7aaaad73cf
commit
47cda47c42
11 changed files with 83 additions and 51 deletions
|
@ -1414,9 +1414,14 @@ void CompileBroker::init_compiler_thread_log() {
|
|||
intx thread_id = os::current_thread_id();
|
||||
for (int try_temp_dir = 1; try_temp_dir >= 0; try_temp_dir--) {
|
||||
const char* dir = (try_temp_dir ? os::get_temp_directory() : NULL);
|
||||
if (dir == NULL) dir = "";
|
||||
sprintf(fileBuf, "%shs_c" UINTX_FORMAT "_pid%u.log",
|
||||
dir, thread_id, os::current_process_id());
|
||||
if (dir == NULL) {
|
||||
jio_snprintf(fileBuf, sizeof(fileBuf), "hs_c" UINTX_FORMAT "_pid%u.log",
|
||||
thread_id, os::current_process_id());
|
||||
} else {
|
||||
jio_snprintf(fileBuf, sizeof(fileBuf),
|
||||
"%s%shs_c" UINTX_FORMAT "_pid%u.log", dir,
|
||||
os::file_separator(), thread_id, os::current_process_id());
|
||||
}
|
||||
fp = fopen(fileBuf, "at");
|
||||
if (fp != NULL) {
|
||||
file = NEW_C_HEAP_ARRAY(char, strlen(fileBuf)+1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue