8233446: Improve error handling when specified dynamic archive doesn't exist
authoriklam
Fri, 22 Nov 2019 15:31:52 -0800
changeset 59235 0f41ac6bb9dd
parent 59234 ee0030a2a306
child 59236 e2ee246e44e3
8233446: Improve error handling when specified dynamic archive doesn't exist Reviewed-by: lfoltan, ccheung
src/hotspot/share/memory/filemap.cpp
--- a/src/hotspot/share/memory/filemap.cpp	Fri Nov 22 14:48:40 2019 -0800
+++ b/src/hotspot/share/memory/filemap.cpp	Fri Nov 22 15:31:52 2019 -0800
@@ -1038,16 +1038,11 @@
   }
   int fd = os::open(_full_path, O_RDONLY | O_BINARY, 0);
   if (fd < 0) {
-    if (is_static()) {
-      if (errno == ENOENT) {
-        // Not locating the shared archive is ok.
-        fail_continue("Specified shared archive not found (%s).", _full_path);
-      } else {
-        fail_continue("Failed to open shared archive file (%s).",
-                      os::strerror(errno));
-      }
+    if (errno == ENOENT) {
+      fail_continue("Specified shared archive not found (%s).", _full_path);
     } else {
-      log_warning(cds, dynamic)("specified dynamic archive doesn't exist: %s", _full_path);
+      fail_continue("Failed to open shared archive file (%s).",
+                    os::strerror(errno));
     }
     return false;
   }