Mercurial > hg > truffle
diff src/os/solaris/vm/perfMemory_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 | 98cb887364d3 |
children | c18cbe5936b8 |
line wrap: on
line diff
--- a/src/os/solaris/vm/perfMemory_solaris.cpp Fri Mar 26 11:10:26 2010 -0400 +++ b/src/os/solaris/vm/perfMemory_solaris.cpp Wed Mar 31 16:51:18 2010 -0700 @@ -147,11 +147,11 @@ const char* tmpdir = os::get_temp_directory(); const char* perfdir = PERFDATA_NAME; - size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 2; + size_t nbytes = strlen(tmpdir) + strlen(perfdir) + strlen(user) + 3; char* dirname = NEW_C_HEAP_ARRAY(char, nbytes); // construct the path name to user specific tmp directory - snprintf(dirname, nbytes, "%s%s_%s", tmpdir, perfdir, user); + snprintf(dirname, nbytes, "%s/%s_%s", tmpdir, perfdir, user); return dirname; } @@ -322,8 +322,9 @@ } char* usrdir_name = NEW_C_HEAP_ARRAY(char, - strlen(tmpdirname) + strlen(dentry->d_name) + 1); + strlen(tmpdirname) + strlen(dentry->d_name) + 2); strcpy(usrdir_name, tmpdirname); + strcat(usrdir_name, "/"); strcat(usrdir_name, dentry->d_name); DIR* subdirp = os::opendir(usrdir_name);