# HG changeset patch # User ctornqvi # Date 1473700599 14400 # Node ID db508643daabc17652524628866c8967d7858b0d # Parent 19f70464986ee0f0d1e509fc4ab586e61332eaf1 8165881: Backout JDK-8164913 Reviewed-by: hseigel diff -r 19f70464986e -r db508643daab hotspot/src/share/vm/prims/jvmtiExport.cpp --- a/hotspot/src/share/vm/prims/jvmtiExport.cpp Mon Sep 12 16:34:36 2016 +0200 +++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp Mon Sep 12 13:16:39 2016 -0400 @@ -2407,7 +2407,9 @@ delete agent_lib; } + // Agent_OnAttach executed so completion status is JNI_OK st->print_cr("%d", result); + result = JNI_OK; } } return result; diff -r 19f70464986e -r db508643daab hotspot/src/share/vm/services/diagnosticCommand.cpp --- a/hotspot/src/share/vm/services/diagnosticCommand.cpp Mon Sep 12 16:34:36 2016 +0200 +++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp Mon Sep 12 13:16:39 2016 -0400 @@ -277,12 +277,11 @@ char *suffix = strrchr(_libpath.value(), '.'); bool is_java_agent = (suffix != NULL) && (strncmp(".jar", suffix, 4) == 0); - jint result = JNI_ERR; if (is_java_agent) { if (_option.value() == NULL) { - result = JvmtiExport::load_agent_library("instrument", "false", - _libpath.value(), output()); + JvmtiExport::load_agent_library("instrument", "false", + _libpath.value(), output()); } else { size_t opt_len = strlen(_libpath.value()) + strlen(_option.value()) + 2; if (opt_len > 4096) { @@ -299,18 +298,14 @@ } jio_snprintf(opt, opt_len, "%s=%s", _libpath.value(), _option.value()); - result = JvmtiExport::load_agent_library("instrument", "false", - opt, output()); + JvmtiExport::load_agent_library("instrument", "false", opt, output()); os::free(opt); } } else { - result = JvmtiExport::load_agent_library(_libpath.value(), "true", - _option.value(), output()); + JvmtiExport::load_agent_library(_libpath.value(), "true", + _option.value(), output()); } - - output()->print_cr("JVMTI agent attach %s.", - (result == JNI_OK) ? "succeeded" : "failed"); } int JVMTIAgentLoadDCmd::num_arguments() {