8186072: dll_build_name returns true even if file is missing

Split dll_build_name into two functions and consolidate to os.cpp file.

Reviewed-by: stuefe, dholmes
This commit is contained in:
Goetz Lindenmaier 2017-08-17 17:26:02 +02:00
parent b885046273
commit b07974fd9f
10 changed files with 96 additions and 299 deletions

View file

@ -3925,13 +3925,12 @@ static OnLoadEntry_t lookup_on_load(AgentLibrary* agent,
}
} else {
// Try to load the agent from the standard dll directory
if (os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(),
if (os::dll_locate_lib(buffer, sizeof(buffer), Arguments::get_dll_dir(),
name)) {
library = os::dll_load(buffer, ebuf, sizeof ebuf);
}
if (library == NULL) { // Try the local directory
char ns[1] = {0};
if (os::dll_build_name(buffer, sizeof(buffer), ns, name)) {
if (library == NULL) { // Try the library path directory.
if (os::dll_build_name(buffer, sizeof(buffer), name)) {
library = os::dll_load(buffer, ebuf, sizeof ebuf);
}
if (library == NULL) {