equal
deleted
inserted
replaced
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; |