-
Notifications
You must be signed in to change notification settings - Fork 726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AIX variables for the load module function to work in AIX. #1437
base: main
Are you sure you want to change the base?
Conversation
Hi @KamathForAIX thank you for this fix. You mentioned that the |
@kwwcb We have to recompile. No other way. @micahsnyder Any update/comment for the PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have any objection to this change though I will have to trust you to test that it works right for AIX.
I've made some suggestions to fix the formatting and reduce a couple lines of duplicate code.
libclamav/others.c
Outdated
ld_library_path = getenv("LD_LIBRARY_PATH"); | ||
#ifdef _AIX | ||
ld_library_path = getenv("LIBPATH"); | ||
#endif /* AIX */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ld_library_path = getenv("LD_LIBRARY_PATH"); | |
#ifdef _AIX | |
ld_library_path = getenv("LIBPATH"); | |
#endif /* AIX */ | |
#ifdef _AIX | |
ld_library_path = getenv("LIBPATH"); | |
#else | |
ld_library_path = getenv("LD_LIBRARY_PATH"); | |
#endif |
libclamav/others.c
Outdated
snprintf(modulename, sizeof(modulename), "%s" PATHSEP "%s%s", tokens[token_index], name, suffixes[i]); | ||
|
||
rhandle = dlopen(modulename, RTLD_NOW); | ||
#ifdef _AIX | ||
snprintf(modulename, sizeof(modulename), "%s%s(%s%s.%d)",name,".a",name,LT_MODULE_EXT,LIBCLAMAV_MAJORVER); | ||
rhandle = dlopen(modulename, RTLD_NOW); | ||
#endif /* AIX */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snprintf(modulename, sizeof(modulename), "%s" PATHSEP "%s%s", tokens[token_index], name, suffixes[i]); | |
rhandle = dlopen(modulename, RTLD_NOW); | |
#ifdef _AIX | |
snprintf(modulename, sizeof(modulename), "%s%s(%s%s.%d)",name,".a",name,LT_MODULE_EXT,LIBCLAMAV_MAJORVER); | |
rhandle = dlopen(modulename, RTLD_NOW); | |
#endif /* AIX */ | |
#ifdef _AIX | |
snprintf(modulename, sizeof(modulename), | |
"%s%s(%s%s.%d)", | |
name, ".a", name, LT_MODULE_EXT, LIBCLAMAV_MAJORVER); | |
#else | |
snprintf(modulename, sizeof(modulename), | |
"%s" PATHSEP "%s%s", | |
tokens[token_index], name, suffixes[i]); | |
#endif | |
rhandle = dlopen(modulename, RTLD_NOW); |
libclamav/others.c
Outdated
#ifdef _AIX | ||
snprintf(modulename, sizeof(modulename), "%s%s(%s%s.%d)",name,".a",name,LT_MODULE_EXT,LIBCLAMAV_MAJORVER); | ||
rhandle = dlopen(modulename, RTLD_NOW | RTLD_MEMBER); | ||
#endif /* AIX */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub isn't allowing me to make a suggestion here because of the deleted line between sprintf
and rhandle
. 🤷 But you should do the same as I suggested above, with #ifdef
+ #else
, and also cleaning up the formatting.
@val-ms Kindly check now. I have made the changes. |
@val-ms Any updates on this PR? Kindly let me know. |
I'm happy with what I see on github. I wanted to run it through our Jenkins but we had an unexpected issue with our build pipeline on macOS last week after an upgrade, so I haven't been able to run the build. I'll run it again as soon as I'm able. |
Closes #1435.