mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34: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
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue