equal
deleted
inserted
replaced
215 } |
215 } |
216 |
216 |
217 EXCEPTION_MARK; // The following call should never throw, but would exit VM on error. |
217 EXCEPTION_MARK; // The following call should never throw, but would exit VM on error. |
218 SharedClassUtil::update_shared_classpath(cpe, ent, st.st_mtime, st.st_size, THREAD); |
218 SharedClassUtil::update_shared_classpath(cpe, ent, st.st_mtime, st.st_size, THREAD); |
219 } else { |
219 } else { |
220 ent->_filesize = -1; |
220 struct stat st; |
221 if (!os::dir_is_empty(name)) { |
221 if ((os::stat(name, &st) == 0) && ((st.st_mode & S_IFDIR) == S_IFDIR)) { |
222 ClassLoader::exit_with_path_failure("Cannot have non-empty directory in archived classpaths", name); |
222 if (!os::dir_is_empty(name)) { |
|
223 ClassLoader::exit_with_path_failure("Cannot have non-empty directory in archived classpaths", name); |
|
224 } |
|
225 ent->_filesize = -1; |
|
226 } else { |
|
227 ent->_filesize = -2; |
223 } |
228 } |
224 } |
229 } |
225 ent->_name = strptr; |
230 ent->_name = strptr; |
226 if (strptr + name_bytes <= strptr_max) { |
231 if (strptr + name_bytes <= strptr_max) { |
227 strncpy(strptr, name, (size_t)name_bytes); // name_bytes includes trailing 0. |
232 strncpy(strptr, name, (size_t)name_bytes); // name_bytes includes trailing 0. |
269 } else if (ent->is_dir()) { |
274 } else if (ent->is_dir()) { |
270 if (!os::dir_is_empty(name)) { |
275 if (!os::dir_is_empty(name)) { |
271 fail_continue("directory is not empty: %s", name); |
276 fail_continue("directory is not empty: %s", name); |
272 ok = false; |
277 ok = false; |
273 } |
278 } |
274 } else { |
279 } else if (ent->is_jar()) { |
275 if (ent->_timestamp != st.st_mtime || |
280 if (ent->_timestamp != st.st_mtime || |
276 ent->_filesize != st.st_size) { |
281 ent->_filesize != st.st_size) { |
277 ok = false; |
282 ok = false; |
278 if (PrintSharedArchiveAndExit) { |
283 if (PrintSharedArchiveAndExit) { |
279 fail_continue(ent->_timestamp != st.st_mtime ? |
284 fail_continue(ent->_timestamp != st.st_mtime ? |