hotspot/src/share/vm/utilities/vmError.cpp
changeset 7901 ea3d83447861
parent 7719 ef138e2849eb
child 8114 340b5b8b544b
equal deleted inserted replaced
7900:4c7fc6332f7e 7901:ea3d83447861
   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);