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:
Coleen Phillimore 2010-03-31 16:51:18 -07:00
parent 7aaaad73cf
commit 47cda47c42
11 changed files with 83 additions and 51 deletions

View file

@ -807,8 +807,8 @@ void VMError::report_and_die() {
if (fd == -1) {
// try temp directory
const char * tmpdir = os::get_temp_directory();
jio_snprintf(buffer, sizeof(buffer), "%shs_err_pid%u.log",
(tmpdir ? tmpdir : ""), os::current_process_id());
jio_snprintf(buffer, sizeof(buffer), "%s%shs_err_pid%u.log",
tmpdir, os::file_separator(), os::current_process_id());
fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666);
}