src/hotspot/share/memory/filemap.cpp
changeset 53911 65f2a401e0eb
parent 53884 1a7b57d02107
child 54340 2221f042556d
equal deleted inserted replaced
53910:072b382347db 53911:65f2a401e0eb
   559 
   559 
   560 
   560 
   561 // Read the FileMapInfo information from the file.
   561 // Read the FileMapInfo information from the file.
   562 bool FileMapInfo::open_for_read() {
   562 bool FileMapInfo::open_for_read() {
   563   _full_path = Arguments::GetSharedArchivePath();
   563   _full_path = Arguments::GetSharedArchivePath();
   564   int fd = open(_full_path, O_RDONLY | O_BINARY, 0);
   564   int fd = os::open(_full_path, O_RDONLY | O_BINARY, 0);
   565   if (fd < 0) {
   565   if (fd < 0) {
   566     if (errno == ENOENT) {
   566     if (errno == ENOENT) {
   567       // Not locating the shared archive is ok.
   567       // Not locating the shared archive is ok.
   568       fail_continue("Specified shared archive not found.");
   568       fail_continue("Specified shared archive not found.");
   569     } else {
   569     } else {
   594 #endif
   594 #endif
   595 
   595 
   596   // Use remove() to delete the existing file because, on Unix, this will
   596   // Use remove() to delete the existing file because, on Unix, this will
   597   // allow processes that have it open continued access to the file.
   597   // allow processes that have it open continued access to the file.
   598   remove(_full_path);
   598   remove(_full_path);
   599   int fd = open(_full_path, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0444);
   599   int fd = os::open(_full_path, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0444);
   600   if (fd < 0) {
   600   if (fd < 0) {
   601     fail_stop("Unable to create shared archive file %s: (%s).", _full_path,
   601     fail_stop("Unable to create shared archive file %s: (%s).", _full_path,
   602               os::strerror(errno));
   602               os::strerror(errno));
   603   }
   603   }
   604   _fd = fd;
   604   _fd = fd;