Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
1330:4a9cc99938e3 | 1353:a2ea687fdc7c |
---|---|
996 return 0; | 996 return 0; |
997 } | 997 } |
998 | 998 |
999 const char* os::dll_file_extension() { return ".dll"; } | 999 const char* os::dll_file_extension() { return ".dll"; } |
1000 | 1000 |
1001 const char * os::get_temp_directory() | 1001 const char* os::get_temp_directory() { |
1002 { | 1002 const char *prop = Arguments::get_property("java.io.tmpdir"); |
1003 static char path_buf[MAX_PATH]; | 1003 if (prop != 0) return prop; |
1004 if (GetTempPath(MAX_PATH, path_buf)>0) | 1004 static char path_buf[MAX_PATH]; |
1005 return path_buf; | 1005 if (GetTempPath(MAX_PATH, path_buf)>0) |
1006 else{ | 1006 return path_buf; |
1007 path_buf[0]='\0'; | 1007 else{ |
1008 return path_buf; | 1008 path_buf[0]='\0'; |
1009 } | 1009 return path_buf; |
1010 } | |
1010 } | 1011 } |
1011 | 1012 |
1012 static bool file_exists(const char* filename) { | 1013 static bool file_exists(const char* filename) { |
1013 if (filename == NULL || strlen(filename) == 0) { | 1014 if (filename == NULL || strlen(filename) == 0) { |
1014 return false; | 1015 return false; |