--- a/hotspot/src/share/vm/runtime/thread.cpp Thu Nov 08 22:39:08 2012 +0100
+++ b/hotspot/src/share/vm/runtime/thread.cpp Fri Nov 09 09:45:00 2012 -0800
@@ -3753,8 +3753,10 @@
}
} else {
// Try to load the agent from the standard dll directory
- os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), name);
- library = os::dll_load(buffer, ebuf, sizeof ebuf);
+ if (os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(),
+ name)) {
+ library = os::dll_load(buffer, ebuf, sizeof ebuf);
+ }
#ifdef KERNEL
// Download instrument dll
if (library == NULL && strcmp(name, "instrument") == 0) {
@@ -3779,8 +3781,9 @@
#endif // KERNEL
if (library == NULL) { // Try the local directory
char ns[1] = {0};
- os::dll_build_name(buffer, sizeof(buffer), ns, name);
- library = os::dll_load(buffer, ebuf, sizeof ebuf);
+ if (os::dll_build_name(buffer, sizeof(buffer), ns, name)) {
+ library = os::dll_load(buffer, ebuf, sizeof ebuf);
+ }
if (library == NULL) {
const char *sub_msg = " on the library path, with error: ";
size_t len = strlen(msg) + strlen(name) + strlen(sub_msg) + strlen(ebuf) + 1;