6685121: (launcher) make ReportErrorMessages accessible by other launcher subsystems

Provided error reporting interfaces to other java subsystems that the launcher uses.

Reviewed-by: darcy
This commit is contained in:
Kumar Srinivasan 2008-08-26 10:21:20 -07:00
parent e2c297b29f
commit 136ad92f3d
7 changed files with 115 additions and 111 deletions

View File

@ -113,7 +113,11 @@ ifeq ($(PLATFORM), windows)
JAVALIB =
OTHER_LCF = -export:JLI_Launch \
-export:JLI_ManifestIterate \
-export:JLI_SetTraceLauncher
-export:JLI_SetTraceLauncher \
-export:JLI_ReportErrorMessage \
-export:JLI_ReportErrorMessageSys \
-export:JLI_ReportMessage \
-export:JLI_ReportExceptionDescription
endif

View File

@ -1,5 +1,5 @@
#
# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
# Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -30,6 +30,10 @@ SUNWprivate_1.1 {
JLI_Launch;
JLI_ManifestIterate;
JLI_SetTraceLauncher;
JLI_ReportErrorMessage;
JLI_ReportErrorMessageSys;
JLI_ReportMessage;
JLI_ReportExceptionDescription;
local:
*;
};

View File

@ -25,8 +25,8 @@
/*
* This file primarily consists of all the error and warning messages, that
* are used in ReportErrorMessage. All message must be defined here, in order
* to help in I18N/L10N the messages.
* are used in JLI_ReportErrorMessage. All message must be defined here, in
* order to help with localizing the messages.
*/
#ifndef _EMESSAGES_H

View File

@ -148,7 +148,7 @@ static void ShowSplashScreen();
static jboolean IsWildCardEnabled();
#define ARG_CHECK(n, f, a) if (n < 1) { \
ReportErrorMessage(f, a); \
JLI_ReportErrorMessage(f, a); \
printUsage = JNI_TRUE; \
*pret = 1; \
return JNI_TRUE; \
@ -326,15 +326,15 @@ JavaMain(void * _args)
start = CounterGet();
if (!InitializeJVM(&vm, &env, &ifn)) {
ReportErrorMessage(JVM_ERROR1);
JLI_ReportErrorMessage(JVM_ERROR1);
exit(1);
}
if (printVersion || showVersion) {
PrintJavaVersion(env, showVersion);
if ((*env)->ExceptionOccurred(env)) {
ReportExceptionDescription(env);
ReportErrorMessage(JNI_ERROR);
JLI_ReportExceptionDescription(env);
JLI_ReportErrorMessage(JNI_ERROR);
goto leave;
}
if (printVersion) {
@ -347,8 +347,8 @@ JavaMain(void * _args)
if (printXUsage || printUsage || (jarfile == 0 && classname == 0)) {
PrintUsage(env, printXUsage);
if ((*env)->ExceptionOccurred(env)) {
ReportExceptionDescription(env);
ReportErrorMessage(JNI_ERROR);
JLI_ReportExceptionDescription(env);
JLI_ReportErrorMessage(JNI_ERROR);
ret=1;
}
goto leave;
@ -397,43 +397,43 @@ JavaMain(void * _args)
if (jarfile != 0) {
mainClassName = GetMainClassName(env, jarfile);
if ((*env)->ExceptionOccurred(env)) {
ReportExceptionDescription(env);
ReportErrorMessage(JNI_ERROR);
JLI_ReportExceptionDescription(env);
JLI_ReportErrorMessage(JNI_ERROR);
goto leave;
}
if (mainClassName == NULL) {
ReportErrorMessage(JAR_ERROR1,jarfile, GEN_ERROR);
JLI_ReportErrorMessage(JAR_ERROR1,jarfile, GEN_ERROR);
goto leave;
}
classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
if (classname == NULL) {
ReportExceptionDescription(env);
ReportErrorMessage(JNI_ERROR);
JLI_ReportExceptionDescription(env);
JLI_ReportErrorMessage(JNI_ERROR);
goto leave;
}
mainClass = LoadClass(env, classname);
if(mainClass == NULL) { /* exception occured */
ReportExceptionDescription(env);
ReportErrorMessage(CLS_ERROR1, classname);
JLI_ReportExceptionDescription(env);
JLI_ReportErrorMessage(CLS_ERROR1, classname);
goto leave;
}
(*env)->ReleaseStringUTFChars(env, mainClassName, classname);
} else {
mainClassName = NewPlatformString(env, classname);
if (mainClassName == NULL) {
ReportErrorMessage(CLS_ERROR2, classname, GEN_ERROR);
JLI_ReportErrorMessage(CLS_ERROR2, classname, GEN_ERROR);
goto leave;
}
classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
if (classname == NULL) {
ReportExceptionDescription(env);
ReportErrorMessage(JNI_ERROR);
JLI_ReportExceptionDescription(env);
JLI_ReportErrorMessage(JNI_ERROR);
goto leave;
}
mainClass = LoadClass(env, classname);
if(mainClass == NULL) { /* exception occured */
ReportExceptionDescription(env);
ReportErrorMessage(CLS_ERROR1, classname);
JLI_ReportExceptionDescription(env);
JLI_ReportErrorMessage(CLS_ERROR1, classname);
goto leave;
}
(*env)->ReleaseStringUTFChars(env, mainClassName, classname);
@ -444,10 +444,10 @@ JavaMain(void * _args)
"([Ljava/lang/String;)V");
if (mainID == NULL) {
if ((*env)->ExceptionOccurred(env)) {
ReportExceptionDescription(env);
ReportErrorMessage(JNI_ERROR);
JLI_ReportExceptionDescription(env);
JLI_ReportErrorMessage(JNI_ERROR);
} else {
ReportErrorMessage(CLS_ERROR3);
JLI_ReportErrorMessage(CLS_ERROR3);
}
goto leave;
}
@ -459,8 +459,8 @@ JavaMain(void * _args)
mainID, JNI_TRUE);
if( obj == NULL) { /* exception occurred */
ReportExceptionDescription(env);
ReportErrorMessage(JNI_ERROR);
JLI_ReportExceptionDescription(env);
JLI_ReportErrorMessage(JNI_ERROR);
goto leave;
}
@ -469,14 +469,14 @@ JavaMain(void * _args)
(*env)->GetObjectClass(env, obj),
"getModifiers", "()I");
if ((*env)->ExceptionOccurred(env)) {
ReportExceptionDescription(env);
ReportErrorMessage(JNI_ERROR);
JLI_ReportExceptionDescription(env);
JLI_ReportErrorMessage(JNI_ERROR);
goto leave;
}
mods = (*env)->CallIntMethod(env, obj, mid);
if ((mods & 1) == 0) { /* if (!Modifier.isPublic(mods)) ... */
ReportErrorMessage(CLS_ERROR4);
JLI_ReportErrorMessage(CLS_ERROR4);
goto leave;
}
}
@ -484,8 +484,8 @@ JavaMain(void * _args)
/* Build argument array */
mainArgs = NewPlatformStringArray(env, argv, argc);
if (mainArgs == NULL) {
ReportExceptionDescription(env);
ReportErrorMessage(JNI_ERROR);
JLI_ReportExceptionDescription(env);
JLI_ReportErrorMessage(JNI_ERROR);
goto leave;
}
@ -506,7 +506,7 @@ JavaMain(void * _args)
* launcher's return code except by calling System.exit.
*/
if ((*vm)->DetachCurrentThread(vm) != 0) {
ReportErrorMessage(JVM_ERROR2);
JLI_ReportErrorMessage(JVM_ERROR2);
ret = 1;
goto leave;
}
@ -635,7 +635,7 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) {
if (loopCount > knownVMsCount) {
if (!speculative) {
ReportErrorMessage(CFG_ERROR1);
JLI_ReportErrorMessage(CFG_ERROR1);
exit(1);
} else {
return "ERROR";
@ -645,7 +645,7 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) {
if (nextIdx < 0) {
if (!speculative) {
ReportErrorMessage(CFG_ERROR2, knownVMs[jvmidx].alias);
JLI_ReportErrorMessage(CFG_ERROR2, knownVMs[jvmidx].alias);
exit(1);
} else {
return "ERROR";
@ -660,7 +660,7 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) {
switch (knownVMs[jvmidx].flag) {
case VM_WARN:
if (!speculative) {
ReportErrorMessage(CFG_WARN1, jvmtype, knownVMs[0].name + 1);
JLI_ReportErrorMessage(CFG_WARN1, jvmtype, knownVMs[0].name + 1);
}
/* fall through */
case VM_IGNORE:
@ -670,7 +670,7 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) {
break;
case VM_ERROR:
if (!speculative) {
ReportErrorMessage(CFG_ERROR3, jvmtype);
JLI_ReportErrorMessage(CFG_ERROR3, jvmtype);
exit(1);
} else {
return "ERROR";
@ -879,9 +879,9 @@ SelectVersion(int argc, char **argv, char **main_class)
if (jarflag && operand) {
if ((res = JLI_ParseManifest(operand, &info)) != 0) {
if (res == -1)
ReportErrorMessage(JAR_ERROR2, operand);
JLI_ReportErrorMessage(JAR_ERROR2, operand);
else
ReportErrorMessage(JAR_ERROR3, operand);
JLI_ReportErrorMessage(JAR_ERROR3, operand);
exit(1);
}
@ -948,7 +948,7 @@ SelectVersion(int argc, char **argv, char **main_class)
* Check for correct syntax of the version specification (JSR 56).
*/
if (!JLI_ValidVersionString(info.jre_version)) {
ReportErrorMessage(SPC_ERROR1, info.jre_version);
JLI_ReportErrorMessage(SPC_ERROR1, info.jre_version);
exit(1);
}
@ -970,7 +970,7 @@ SelectVersion(int argc, char **argv, char **main_class)
JLI_MemFree(new_argv);
return;
} else {
ReportErrorMessage(CFG_ERROR4, info.jre_version);
JLI_ReportErrorMessage(CFG_ERROR4, info.jre_version);
exit(1);
}
}
@ -1040,7 +1040,7 @@ ParseArguments(int *pargc, char ***pargv, char **pjarfile,
* command line options.
*/
} else if (JLI_StrCmp(arg, "-fullversion") == 0) {
ReportMessage("%s full version \"%s\"", _launcher_name, GetFullVersion());
JLI_ReportMessage("%s full version \"%s\"", _launcher_name, GetFullVersion());
return JNI_FALSE;
} else if (JLI_StrCmp(arg, "-verbosegc") == 0) {
AddOption("-verbose:gc", NULL);
@ -1080,7 +1080,7 @@ ParseArguments(int *pargc, char ***pargv, char **pjarfile,
JLI_StrCmp(arg, "-cs") == 0 ||
JLI_StrCmp(arg, "-noasyncgc") == 0) {
/* No longer supported */
ReportErrorMessage(ARG_WARN, arg);
JLI_ReportErrorMessage(ARG_WARN, arg);
} else if (JLI_StrCCmp(arg, "-version:") == 0 ||
JLI_StrCmp(arg, "-no-jre-restrict-search") == 0 ||
JLI_StrCmp(arg, "-jre-restrict-search") == 0 ||
@ -1143,12 +1143,12 @@ InitializeJVM(JavaVM **pvm, JNIEnv **penv, InvocationFunctions *ifn)
#define NULL_CHECK0(e) if ((e) == 0) { \
ReportErrorMessage(JNI_ERROR); \
JLI_ReportErrorMessage(JNI_ERROR); \
return 0; \
}
#define NULL_CHECK(e) if ((e) == 0) { \
ReportErrorMessage(JNI_ERROR); \
JLI_ReportErrorMessage(JNI_ERROR); \
return; \
}
@ -1351,7 +1351,7 @@ TranslateApplicationArgs(int jargc, const char **jargv, int *pargc, char ***parg
char *arg = argv[i];
if (arg[0] == '-' && arg[1] == 'J') {
if (arg[2] == '\0') {
ReportErrorMessage(ARG_ERROR3);
JLI_ReportErrorMessage(ARG_ERROR3);
exit(1);
}
*nargv++ = arg + 2;
@ -1418,7 +1418,7 @@ AddApplicationOptions(int cpathc, const char **cpathv)
}
if (!GetApplicationHome(home, sizeof(home))) {
ReportErrorMessage(CFG_ERROR5);
JLI_ReportErrorMessage(CFG_ERROR5);
return JNI_FALSE;
}
@ -1691,7 +1691,7 @@ ReadKnownVMs(const char *jrepath, const char * arch, jboolean speculative)
jvmCfg = fopen(jvmCfgName, "r");
if (jvmCfg == NULL) {
if (!speculative) {
ReportErrorMessage(CFG_ERROR6, jvmCfgName);
JLI_ReportErrorMessage(CFG_ERROR6, jvmCfgName);
exit(1);
} else {
return -1;
@ -1703,7 +1703,7 @@ ReadKnownVMs(const char *jrepath, const char * arch, jboolean speculative)
if (line[0] == '#')
continue;
if (line[0] != '-') {
ReportErrorMessage(CFG_WARN2, lineno, jvmCfgName);
JLI_ReportErrorMessage(CFG_WARN2, lineno, jvmCfgName);
}
if (cnt >= knownVMsLimit) {
GrowKnownVMs(cnt);
@ -1711,13 +1711,13 @@ ReadKnownVMs(const char *jrepath, const char * arch, jboolean speculative)
line[JLI_StrLen(line)-1] = '\0'; /* remove trailing newline */
tmpPtr = line + JLI_StrCSpn(line, whiteSpace);
if (*tmpPtr == 0) {
ReportErrorMessage(CFG_WARN3, lineno, jvmCfgName);
JLI_ReportErrorMessage(CFG_WARN3, lineno, jvmCfgName);
} else {
/* Null-terminate this string for JLI_StringDup below */
*tmpPtr++ = 0;
tmpPtr += JLI_StrSpn(tmpPtr, whiteSpace);
if (*tmpPtr == 0) {
ReportErrorMessage(CFG_WARN3, lineno, jvmCfgName);
JLI_ReportErrorMessage(CFG_WARN3, lineno, jvmCfgName);
} else {
if (!JLI_StrCCmp(tmpPtr, "KNOWN")) {
vmType = VM_KNOWN;
@ -1727,7 +1727,7 @@ ReadKnownVMs(const char *jrepath, const char * arch, jboolean speculative)
tmpPtr += JLI_StrSpn(tmpPtr, whiteSpace);
}
if (*tmpPtr == 0) {
ReportErrorMessage(CFG_WARN3, lineno, jvmCfgName);
JLI_ReportErrorMessage(CFG_WARN3, lineno, jvmCfgName);
} else {
/* Null terminate altVMName */
altVMName = tmpPtr;
@ -1747,7 +1747,7 @@ ReadKnownVMs(const char *jrepath, const char * arch, jboolean speculative)
tmpPtr += JLI_StrSpn(tmpPtr, whiteSpace);
}
if (*tmpPtr == 0) {
ReportErrorMessage(CFG_WARN4, lineno, jvmCfgName);
JLI_ReportErrorMessage(CFG_WARN4, lineno, jvmCfgName);
} else {
/* Null terminate server class VM name */
serverClassVMName = tmpPtr;
@ -1756,7 +1756,7 @@ ReadKnownVMs(const char *jrepath, const char * arch, jboolean speculative)
vmType = VM_IF_SERVER_CLASS;
}
} else {
ReportErrorMessage(CFG_WARN5, lineno, &jvmCfgName[0]);
JLI_ReportErrorMessage(CFG_WARN5, lineno, &jvmCfgName[0]);
vmType = VM_KNOWN;
}
}
@ -2019,7 +2019,7 @@ RemovableOption(char * option)
* A utility procedure to always print to stderr
*/
void
ReportMessage(const char* fmt, ...)
JLI_ReportMessage(const char* fmt, ...)
{
va_list vl;
va_start(vl, fmt);

View File

@ -121,24 +121,20 @@ void CreateExecutionEnvironment(int *_argc,
char jvmpath[],
jint so_jvmpath,
char **original_argv);
/* Reports an error message to stderr or a window as appropriate. */
void JLI_ReportErrorMessage(const char * message, ...);
/* Reports a system error message to stderr or a window */
void JLI_ReportErrorMessageSys(const char * message, ...);
/* Reports an error message only to stderr. */
void JLI_ReportMessage(const char * message, ...);
/*
* Report an error message to stderr or a window as appropriate.
*/
void ReportErrorMessage(const char * message, ...);
void ReportErrorMessageSys(const char * format, ...);
/*
* Report an error message only to stderr.
*/
void ReportMessage(const char * message, ...);
/*
* Report an exception which terminates the vm to stderr or a window
* Reports an exception which terminates the vm to stderr or a window
* as appropriate.
*/
void ReportExceptionDescription(JNIEnv * env);
void JLI_ReportExceptionDescription(JNIEnv * env);
void PrintMachineDependentOptions();
const char *jlong_format_specifier();

View File

@ -289,13 +289,13 @@ CreateExecutionEnvironment(int *_argcp,
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 @@ CreateExecutionEnvironment(int *_argcp,
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 @@ CreateExecutionEnvironment(int *_argcp,
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 @@ CreateExecutionEnvironment(int *_argcp,
break;
default:
ReportErrorMessage(JRE_ERROR3, __LINE__);
JLI_ReportErrorMessage(JRE_ERROR3, __LINE__);
exit(1); /* unknown value in wanted */
break;
}
@ -553,17 +553,17 @@ CreateExecutionEnvironment(int *_argcp,
(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 @@ GetJREPath(char *path, jint pathsize, const char * arch, jboolean speculative)
}
if (!speculative)
ReportErrorMessage(JRE_ERROR8 JAVA_DLL);
JLI_ReportErrorMessage(JRE_ERROR8 JAVA_DLL);
return JNI_FALSE;
found:
@ -680,13 +680,13 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
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 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
return JNI_TRUE;
error:
ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
return JNI_FALSE;
}
@ -848,7 +848,7 @@ SetExecname(char **argv)
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 @@ SetExecname(char **argv)
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 @@ void ReportErrorMessage(const char* fmt, ...) {
va_end(vl);
}
void ReportErrorMessageSys(const char* fmt, ...) {
void JLI_ReportErrorMessageSys(const char* fmt, ...) {
va_list vl;
char *emsg;
@ -912,7 +912,7 @@ void ReportErrorMessageSys(const char* fmt, ...) {
va_end(vl);
}
void ReportExceptionDescription(JNIEnv * env) {
void JLI_ReportExceptionDescription(JNIEnv * env) {
(*env)->ExceptionDescribe(env);
}
@ -1078,7 +1078,7 @@ ExecJRE(char *jre, char **argv)
* 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 @@ ExecJRE(char *jre, char **argv)
*/
SetExecname(argv);
if (execname == NULL) {
ReportErrorMessage(JRE_ERROR10);
JLI_ReportErrorMessage(JRE_ERROR10);
exit(1);
}
@ -1106,7 +1106,7 @@ ExecJRE(char *jre, char **argv)
* 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 @@ ExecJRE(char *jre, char **argv)
(void)fflush(stdout);
(void)fflush(stderr);
execv(wanted, argv);
ReportErrorMessageSys(JRE_ERROR12, wanted);
JLI_ReportErrorMessageSys(JRE_ERROR12, wanted);
exit(1);
}

View File

@ -105,26 +105,26 @@ CreateExecutionEnvironment(int *_argc,
}
}
if (running != wanted) {
ReportErrorMessage(JRE_ERROR2, wanted);
JLI_ReportErrorMessage(JRE_ERROR2, wanted);
exit(1);
}
/* Find out where the JRE is that we will be using. */
if (!GetJREPath(jrepath, so_jrepath)) {
ReportErrorMessage(JRE_ERROR1);
JLI_ReportErrorMessage(JRE_ERROR1);
exit(2);
}
/* Find the specified JVM type */
if (ReadKnownVMs(jrepath, (char*)GetArch(), JNI_FALSE) < 1) {
ReportErrorMessage(CFG_ERROR7);
JLI_ReportErrorMessage(CFG_ERROR7);
exit(1);
}
jvmtype = CheckJvmType(_argc, _argv, JNI_FALSE);
jvmpath[0] = '\0';
if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath)) {
ReportErrorMessage(CFG_ERROR8, jvmtype, jvmpath);
JLI_ReportErrorMessage(CFG_ERROR8, jvmtype, jvmpath);
exit(4);
}
/* If we got here, jvmpath has been correctly initialized. */
@ -160,7 +160,7 @@ GetJREPath(char *path, jint pathsize)
goto found;
}
ReportErrorMessage(JRE_ERROR8 JAVA_DLL);
JLI_ReportErrorMessage(JRE_ERROR8 JAVA_DLL);
return JNI_FALSE;
found:
@ -212,7 +212,7 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
JLI_TraceLauncher("CRT path is %s\n", crtpath);
if (_access(crtpath, 0) == 0) {
if (LoadLibrary(crtpath) == 0) {
ReportErrorMessage(DLL_ERROR4, crtpath);
JLI_ReportErrorMessage(DLL_ERROR4, crtpath);
return JNI_FALSE;
}
}
@ -220,7 +220,7 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
/* Load the Java VM DLL */
if ((handle = LoadLibrary(jvmpath)) == 0) {
ReportErrorMessage(DLL_ERROR4, (char *)jvmpath);
JLI_ReportErrorMessage(DLL_ERROR4, (char *)jvmpath);
return JNI_FALSE;
}
@ -230,7 +230,7 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
ifn->GetDefaultJavaVMInitArgs =
(void *)GetProcAddress(handle, "JNI_GetDefaultJavaVMInitArgs");
if (ifn->CreateJavaVM == 0 || ifn->GetDefaultJavaVMInitArgs == 0) {
ReportErrorMessage(JNI_ERROR1, (char *)jvmpath);
JLI_ReportErrorMessage(JNI_ERROR1, (char *)jvmpath);
return JNI_FALSE;
}
@ -292,19 +292,19 @@ GetPublicJREHome(char *buf, jint bufsize)
/* Find the current version of the JRE */
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, JRE_KEY, 0, KEY_READ, &key) != 0) {
ReportErrorMessage(REG_ERROR1, JRE_KEY);
JLI_ReportErrorMessage(REG_ERROR1, JRE_KEY);
return JNI_FALSE;
}
if (!GetStringFromRegistry(key, "CurrentVersion",
version, sizeof(version))) {
ReportErrorMessage(REG_ERROR2, JRE_KEY);
JLI_ReportErrorMessage(REG_ERROR2, JRE_KEY);
RegCloseKey(key);
return JNI_FALSE;
}
if (JLI_StrCmp(version, GetDotVersion()) != 0) {
ReportErrorMessage(REG_ERROR3, JRE_KEY, version, GetDotVersion()
JLI_ReportErrorMessage(REG_ERROR3, JRE_KEY, version, GetDotVersion()
);
RegCloseKey(key);
return JNI_FALSE;
@ -312,13 +312,13 @@ GetPublicJREHome(char *buf, jint bufsize)
/* Find directory where the current version is installed. */
if (RegOpenKeyEx(key, version, 0, KEY_READ, &subkey) != 0) {
ReportErrorMessage(REG_ERROR1, JRE_KEY, version);
JLI_ReportErrorMessage(REG_ERROR1, JRE_KEY, version);
RegCloseKey(key);
return JNI_FALSE;
}
if (!GetStringFromRegistry(subkey, "JavaHome", buf, bufsize)) {
ReportErrorMessage(REG_ERROR4, JRE_KEY, version);
JLI_ReportErrorMessage(REG_ERROR4, JRE_KEY, version);
RegCloseKey(key);
RegCloseKey(subkey);
return JNI_FALSE;
@ -370,7 +370,7 @@ jlong Counter2Micros(jlong counts)
}
void
ReportErrorMessage(const char* fmt, ...) {
JLI_ReportErrorMessage(const char* fmt, ...) {
va_list vl;
va_start(vl,fmt);
@ -394,12 +394,12 @@ ReportErrorMessage(const char* fmt, ...) {
}
/*
* Just like ReportErrorMessage, except that it concatenates the system
* Just like JLI_ReportErrorMessage, except that it concatenates the system
* error message if any, its upto the calling routine to correctly
* format the separation of the messages.
*/
void
ReportErrorMessageSys(const char *fmt, ...)
JLI_ReportErrorMessageSys(const char *fmt, ...)
{
va_list vl;
@ -462,7 +462,7 @@ ReportErrorMessageSys(const char *fmt, ...)
va_end(vl);
}
void ReportExceptionDescription(JNIEnv * env) {
void JLI_ReportExceptionDescription(JNIEnv * env) {
if (IsJavaw()) {
/*
* This code should be replaced by code which opens a window with
@ -733,7 +733,7 @@ ExecJRE(char *jre, char **argv) {
*/
len = GetModuleFileName(NULL, path, MAXPATHLEN + 1);
if (len == 0 || len > MAXPATHLEN) {
ReportErrorMessageSys(JRE_ERROR9, progname);
JLI_ReportErrorMessageSys(JRE_ERROR9, progname);
exit(1);
}
@ -766,7 +766,7 @@ ExecJRE(char *jre, char **argv) {
* If it weren't for this semantic flaw, the code below would be ...
*
* execv(path, argv);
* ReportErrorMessage("Error: Exec of %s failed\n", path);
* JLI_ReportErrorMessage("Error: Exec of %s failed\n", path);
* exit(1);
*
* The incorrect exec semantics could be addressed by:
@ -876,7 +876,7 @@ ExecJRE(char *jre, char **argv) {
(LPCTSTR)NULL, /* current directory */
(LPSTARTUPINFO)&si, /* (in) startup information */
(LPPROCESS_INFORMATION)&pi)) { /* (out) process information */
ReportErrorMessageSys(SYS_ERROR1, path);
JLI_ReportErrorMessageSys(SYS_ERROR1, path);
exit(1);
}
@ -884,7 +884,7 @@ ExecJRE(char *jre, char **argv) {
if (GetExitCodeProcess(pi.hProcess, &exitCode) == FALSE)
exitCode = 1;
} else {
ReportErrorMessage(SYS_ERROR2);
JLI_ReportErrorMessage(SYS_ERROR2);
exitCode = 1;
}