mirror of
https://github.com/openjdk/jdk8u.git
synced 2025-12-10 10:44:16 -06:00
8331791: [8u] AIX build break from JDK-8320005 backport
Reviewed-by: sgehwolf
This commit is contained in:
parent
853a87a8e4
commit
216b8cbf51
@ -1480,10 +1480,11 @@ static void* dll_load_library(const char *filename, char *ebuf, int ebuflen) {
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Load library named <filename>
|
||||
// If filename matches <name>.so, and loading fails, repeat with <name>.a.
|
||||
void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
void* result = nullptr;
|
||||
void* result = NULL;
|
||||
char* const file_path = strdup(filename);
|
||||
char* const pointer_to_dot = strrchr(file_path, '.');
|
||||
const char old_extension[] = ".so";
|
||||
@ -1493,11 +1494,11 @@ void *os::dll_load(const char *filename, char *ebuf, int ebuflen) {
|
||||
result = dll_load_library(filename, ebuf, ebuflen);
|
||||
// If the load fails,we try to reload by changing the extension to .a for .so files only.
|
||||
// Shared object in .so format dont have braces, hence they get removed for archives with members.
|
||||
if (result == nullptr && pointer_to_dot != nullptr && strcmp(pointer_to_dot, old_extension) == 0) {
|
||||
if (result == NULL && pointer_to_dot != NULL && strcmp(pointer_to_dot, old_extension) == 0) {
|
||||
snprintf(pointer_to_dot, sizeof(old_extension), "%s", new_extension);
|
||||
result = dll_load_library(file_path, ebuf, ebuflen);
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(char, file_path);
|
||||
FREE_C_HEAP_ARRAY(char, file_path, mtInternal);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user