From 436960308cebe020549fcdbb4bcb12c90ce7aeb8 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Sat, 10 May 2025 15:16:19 +0000 Subject: [PATCH] 8356597: AOT cache and CDS archive should not be created in read-only mode Reviewed-by: shade, kvn --- src/hotspot/share/cds/filemap.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/hotspot/share/cds/filemap.cpp b/src/hotspot/share/cds/filemap.cpp index ff537ef96d6..7414a553a74 100644 --- a/src/hotspot/share/cds/filemap.cpp +++ b/src/hotspot/share/cds/filemap.cpp @@ -747,8 +747,7 @@ void FileMapInfo::open_as_output() { // Use remove() to delete the existing file because, on Unix, this will // allow processes that have it open continued access to the file. remove(_full_path); - int mode = CDSConfig::is_dumping_preimage_static_archive() ? 0666 : 0444; - int fd = os::open(_full_path, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, mode); + int fd = os::open(_full_path, O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0666); if (fd < 0) { log_error(cds)("Unable to create %s %s: (%s).", CDSConfig::type_of_archive_being_written(), _full_path, os::strerror(errno));