6685121: (launcher) make ReportErrorMessages accessible by other launcher subsystems
Summary: provided error reporting interfaces to other java subsystems that the launcher uses.
Reviewed-by: darcy
diff --git a/src/solaris/bin/java_md.c b/src/solaris/bin/java_md.c
index c7c0da6..6ecd968 100644
--- a/src/solaris/bin/java_md.c
+++ b/src/solaris/bin/java_md.c
@@ -289,13 +289,13 @@
if (wanted == running) {
/* Find out where the JRE is that we will be using. */
if (!GetJREPath(jrepath, so_jrepath, arch, JNI_FALSE) ) {
- ReportErrorMessage(JRE_ERROR1);
+ JLI_ReportErrorMessage(JRE_ERROR1);
exit(2);
}
/* Find the specified JVM type */
if (ReadKnownVMs(jrepath, arch, JNI_FALSE) < 1) {
- ReportErrorMessage(CFG_ERROR7);
+ JLI_ReportErrorMessage(CFG_ERROR7);
exit(1);
}
@@ -303,7 +303,7 @@
jvmtype = CheckJvmType(_argcp, _argvp, JNI_FALSE);
if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch )) {
- ReportErrorMessage(CFG_ERROR8, jvmtype, jvmpath);
+ JLI_ReportErrorMessage(CFG_ERROR8, jvmtype, jvmpath);
exit(4);
}
} else { /* do the same speculatively or exit */
@@ -330,7 +330,7 @@
EndDataModelSpeculate: /* give up and let other code report error message */
;
#else
- ReportErrorMessage(JRE_ERROR2, wanted);
+ JLI_ReportErrorMessage(JRE_ERROR2, wanted);
exit(1);
#endif
}
@@ -391,7 +391,7 @@
break;
default:
- ReportErrorMessage(JRE_ERROR3, __LINE__);
+ JLI_ReportErrorMessage(JRE_ERROR3, __LINE__);
exit(1); /* unknown value in wanted */
break;
}
@@ -553,17 +553,17 @@
(void)fflush(stdout);
(void)fflush(stderr);
execve(newexec, argv, newenvp);
- ReportErrorMessageSys(JRE_ERROR4, newexec);
+ JLI_ReportErrorMessageSys(JRE_ERROR4, newexec);
#ifdef DUAL_MODE
if (running != wanted) {
- ReportErrorMessage(JRE_ERROR5, wanted, running);
+ JLI_ReportErrorMessage(JRE_ERROR5, wanted, running);
# ifdef __solaris__
# ifdef __sparc
- ReportErrorMessage(JRE_ERROR6);
+ JLI_ReportErrorMessage(JRE_ERROR6);
# else
- ReportErrorMessage(JRE_ERROR7);
+ JLI_ReportErrorMessage(JRE_ERROR7);
# endif
}
# endif
@@ -627,7 +627,7 @@
}
if (!speculative)
- ReportErrorMessage(JRE_ERROR8 JAVA_DLL);
+ JLI_ReportErrorMessage(JRE_ERROR8 JAVA_DLL);
return JNI_FALSE;
found:
@@ -680,13 +680,13 @@
if(length > 0) {
location = JLI_StrStr(buf, "sparcv8plus ");
if(location == NULL) {
- ReportErrorMessage(JVM_ERROR3);
+ JLI_ReportErrorMessage(JVM_ERROR3);
return JNI_FALSE;
}
}
}
#endif
- ReportErrorMessage(DLL_ERROR1, __LINE__);
+ JLI_ReportErrorMessage(DLL_ERROR1, __LINE__);
goto error;
}
@@ -703,7 +703,7 @@
return JNI_TRUE;
error:
- ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
+ JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
return JNI_FALSE;
}
@@ -848,7 +848,7 @@
fptr = (int (*)())dlsym(RTLD_DEFAULT, "main");
if (fptr == NULL) {
- ReportErrorMessage(DLL_ERROR3, dlerror());
+ JLI_ReportErrorMessage(DLL_ERROR3, dlerror());
return JNI_FALSE;
}
@@ -885,7 +885,7 @@
return exec_path;
}
-void ReportErrorMessage(const char* fmt, ...) {
+void JLI_ReportErrorMessage(const char* fmt, ...) {
va_list vl;
va_start(vl, fmt);
vfprintf(stderr, fmt, vl);
@@ -893,7 +893,7 @@
va_end(vl);
}
-void ReportErrorMessageSys(const char* fmt, ...) {
+void JLI_ReportErrorMessageSys(const char* fmt, ...) {
va_list vl;
char *emsg;
@@ -912,7 +912,7 @@
va_end(vl);
}
-void ReportExceptionDescription(JNIEnv * env) {
+void JLI_ReportExceptionDescription(JNIEnv * env) {
(*env)->ExceptionDescribe(env);
}
@@ -1078,7 +1078,7 @@
* Resolve the real path to the directory containing the selected JRE.
*/
if (realpath(jre, wanted) == NULL) {
- ReportErrorMessage(JRE_ERROR9, jre);
+ JLI_ReportErrorMessage(JRE_ERROR9, jre);
exit(1);
}
@@ -1087,7 +1087,7 @@
*/
SetExecname(argv);
if (execname == NULL) {
- ReportErrorMessage(JRE_ERROR10);
+ JLI_ReportErrorMessage(JRE_ERROR10);
exit(1);
}
@@ -1106,7 +1106,7 @@
* can be so deadly.
*/
if (JLI_StrLen(wanted) + JLI_StrLen(progname) + 6 > PATH_MAX) {
- ReportErrorMessage(JRE_ERROR11);
+ JLI_ReportErrorMessage(JRE_ERROR11);
exit(1);
}
@@ -1126,7 +1126,7 @@
(void)fflush(stdout);
(void)fflush(stderr);
execv(wanted, argv);
- ReportErrorMessageSys(JRE_ERROR12, wanted);
+ JLI_ReportErrorMessageSys(JRE_ERROR12, wanted);
exit(1);
}