mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8224958: add os::dll_load calls to event log
Reviewed-by: dholmes, mdoerr, stuefe
This commit is contained in:
parent
189345db4a
commit
0bf2650bb1
5 changed files with 59 additions and 21 deletions
|
@ -1881,8 +1881,17 @@ void * os::Linux::dlopen_helper(const char *filename, char *ebuf,
|
|||
int ebuflen) {
|
||||
void * result = ::dlopen(filename, RTLD_LAZY);
|
||||
if (result == NULL) {
|
||||
::strncpy(ebuf, ::dlerror(), ebuflen - 1);
|
||||
ebuf[ebuflen-1] = '\0';
|
||||
const char* error_report = ::dlerror();
|
||||
if (error_report == NULL) {
|
||||
error_report = "dlerror returned no error description";
|
||||
}
|
||||
if (ebuf != NULL && ebuflen > 0) {
|
||||
::strncpy(ebuf, error_report, ebuflen-1);
|
||||
ebuf[ebuflen-1]='\0';
|
||||
}
|
||||
Events::log(NULL, "Loading shared library %s failed, %s", filename, error_report);
|
||||
} else {
|
||||
Events::log(NULL, "Loaded shared library %s", filename);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue