Mercurial > hg > graal-compiler
diff src/share/vm/compiler/compileBroker.cpp @ 1353:a2ea687fdc7c
6938627: Make temporary directory use property java.io.tmpdir when specified
Summary: 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
author | coleenp |
---|---|
date | Wed, 31 Mar 2010 16:51:18 -0700 |
parents | 428a9c451986 |
children | 35069ca331f2 bfe29ec02863 |
line wrap: on
line diff
--- a/src/share/vm/compiler/compileBroker.cpp Fri Mar 26 11:10:26 2010 -0400 +++ b/src/share/vm/compiler/compileBroker.cpp Wed Mar 31 16:51:18 2010 -0700 @@ -1414,9 +1414,14 @@ 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);