src/share/vm/memory/filemap.cpp

Print this page

        

*** 215,228 **** } EXCEPTION_MARK; // The following call should never throw, but would exit VM on error. SharedClassUtil::update_shared_classpath(cpe, ent, st.st_mtime, st.st_size, THREAD); } else { ! ent->_filesize = -1; if (!os::dir_is_empty(name)) { ClassLoader::exit_with_path_failure("Cannot have non-empty directory in archived classpaths", name); } } ent->_name = strptr; if (strptr + name_bytes <= strptr_max) { strncpy(strptr, name, (size_t)name_bytes); // name_bytes includes trailing 0. strptr += name_bytes; --- 215,233 ---- } EXCEPTION_MARK; // The following call should never throw, but would exit VM on error. SharedClassUtil::update_shared_classpath(cpe, ent, st.st_mtime, st.st_size, THREAD); } else { ! struct stat st; ! if ((os::stat(name, &st) == 0) && ((st.st_mode & S_IFDIR) == S_IFDIR)) { if (!os::dir_is_empty(name)) { ClassLoader::exit_with_path_failure("Cannot have non-empty directory in archived classpaths", name); } + ent->_filesize = -1; + } else { + ent->_filesize = -2; + } } ent->_name = strptr; if (strptr + name_bytes <= strptr_max) { strncpy(strptr, name, (size_t)name_bytes); // name_bytes includes trailing 0. strptr += name_bytes;
*** 269,279 **** } else if (ent->is_dir()) { if (!os::dir_is_empty(name)) { fail_continue("directory is not empty: %s", name); ok = false; } ! } else { if (ent->_timestamp != st.st_mtime || ent->_filesize != st.st_size) { ok = false; if (PrintSharedArchiveAndExit) { fail_continue(ent->_timestamp != st.st_mtime ? --- 274,284 ---- } else if (ent->is_dir()) { if (!os::dir_is_empty(name)) { fail_continue("directory is not empty: %s", name); ok = false; } ! } else if (ent->is_jar()) { if (ent->_timestamp != st.st_mtime || ent->_filesize != st.st_size) { ok = false; if (PrintSharedArchiveAndExit) { fail_continue(ent->_timestamp != st.st_mtime ?