Skip to content

Commit

Permalink
8331791: [8u] AIX build break from JDK-8320005 backport
Browse files Browse the repository at this point in the history
Reviewed-by: sgehwolf
  • Loading branch information
Suchismith Roy authored and jerboaa committed May 15, 2024
1 parent 853a87a commit 216b8cb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hotspot/src/os/aix/vm/os_aix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
}

Expand Down

1 comment on commit 216b8cb

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.