comparison src/os/solaris/vm/os_solaris.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
674 } 674 }
675 return privileges; 675 return privileges;
676 } 676 }
677 677
678 678
679 static char* get_property(char* name, char* buffer, int buffer_size) {
680 if (os::getenv(name, buffer, buffer_size)) {
681 return buffer;
682 }
683 static char empty[] = "";
684 return empty;
685 }
686
687
688 void os::init_system_properties_values() { 679 void os::init_system_properties_values() {
689 char arch[12]; 680 char arch[12];
690 sysinfo(SI_ARCHITECTURE, arch, sizeof(arch)); 681 sysinfo(SI_ARCHITECTURE, arch, sizeof(arch));
691 682
692 // The next steps are taken in the product version: 683 // The next steps are taken in the product version:
1824 1815
1825 // DLL functions 1816 // DLL functions
1826 1817
1827 const char* os::dll_file_extension() { return ".so"; } 1818 const char* os::dll_file_extension() { return ".so"; }
1828 1819
1829 const char* os::get_temp_directory() { return "/tmp/"; } 1820 const char* os::get_temp_directory() {
1821 const char *prop = Arguments::get_property("java.io.tmpdir");
1822 return prop == NULL ? "/tmp" : prop;
1823 }
1830 1824
1831 static bool file_exists(const char* filename) { 1825 static bool file_exists(const char* filename) {
1832 struct stat statbuf; 1826 struct stat statbuf;
1833 if (filename == NULL || strlen(filename) == 0) { 1827 if (filename == NULL || strlen(filename) == 0) {
1834 return false; 1828 return false;