Mercurial > hg > truffle
diff src/os/windows/vm/os_windows.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 | 3b3d12e645e7 |
children | f03d0a26bf83 |
line wrap: on
line diff
--- a/src/os/windows/vm/os_windows.cpp Fri Mar 26 11:10:26 2010 -0400 +++ b/src/os/windows/vm/os_windows.cpp Wed Mar 31 16:51:18 2010 -0700 @@ -998,15 +998,16 @@ 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) {