src/share/vm/utilities/vmError.cpp
changeset 1999 2c8e1acf0433
parent 19952ecd0d1194d2
child 2412a541ca8fa0e3
--- a/src/share/vm/utilities/vmError.cpp Fri Nov 05 14:04:32 2010 +0000
+++ b/src/share/vm/utilities/vmError.cpp Wed Jan 12 13:59:18 2011 -0800
@@ -813,11 +813,13 @@ void VMError::report_and_die() {
}
if (fd == -1) {
- // try temp directory
const char * tmpdir = os::get_temp_directory();
- jio_snprintf(buffer, sizeof(buffer), "%s%shs_err_pid%u.log",
- tmpdir, os::file_separator(), os::current_process_id());
- fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+ // try temp directory if it exists.
+ if (tmpdir != NULL && tmpdir[0] != '\0') {
+ jio_snprintf(buffer, sizeof(buffer), "%s%shs_err_pid%u.log",
+ tmpdir, os::file_separator(), os::current_process_id());
+ fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+ }
}
if (fd != -1) {