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

@ -998,15 +998,16 @@ os::closedir(DIR *dirp)
const char* os::dll_file_extension() { return ".dll"; }
const char * os::get_temp_directory()
{
static char path_buf[MAX_PATH];
if (GetTempPath(MAX_PATH, path_buf)>0)
return path_buf;
else{
path_buf[0]='\0';
return path_buf;
}
const char* os::get_temp_directory() {
const char *prop = Arguments::get_property("java.io.tmpdir");
if (prop != 0) return prop;
static char path_buf[MAX_PATH];
if (GetTempPath(MAX_PATH, path_buf)>0)
return path_buf;
else{
path_buf[0]='\0';
return path_buf;
}
}
static bool file_exists(const char* filename) {