comparison src/share/vm/utilities/vmError.cpp @ 2130:34d64ad817f4

7009828: Fix for 6938627 breaks visualvm monitoring when -Djava.io.tmpdir is defined Summary: Change get_temp_directory() back to /tmp and %TEMP% like it always was and where the tools expect it to be. Reviewed-by: phh, dcubed, kamg, alanb
author coleenp
date Wed, 12 Jan 2011 13:59:18 -0800
parents 36c186bcc085
children d8a72fbc4be7
comparison
equal deleted inserted replaced
2129:8f8dfba37802 2130:34d64ad817f4
872 os::file_separator(), os::current_process_id()); 872 os::file_separator(), os::current_process_id());
873 fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666); 873 fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666);
874 } 874 }
875 875
876 if (fd == -1) { 876 if (fd == -1) {
877 // try temp directory
878 const char * tmpdir = os::get_temp_directory(); 877 const char * tmpdir = os::get_temp_directory();
879 jio_snprintf(buffer, sizeof(buffer), "%s%shs_err_pid%u.log", 878 // try temp directory if it exists.
880 tmpdir, os::file_separator(), os::current_process_id()); 879 if (tmpdir != NULL && tmpdir[0] != '\0') {
881 fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666); 880 jio_snprintf(buffer, sizeof(buffer), "%s%shs_err_pid%u.log",
881 tmpdir, os::file_separator(), os::current_process_id());
882 fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666);
883 }
882 } 884 }
883 885
884 if (fd != -1) { 886 if (fd != -1) {
885 out.print_raw("# An error report file with more information is saved as:\n# "); 887 out.print_raw("# An error report file with more information is saved as:\n# ");
886 out.print_raw_cr(buffer); 888 out.print_raw_cr(buffer);