You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2006/01/06 17:27:38 UTC
svn commit: r366523 -
/incubator/harmony/enhanced/classlib/trunk/native-src/linux.IA32/luni/luniglob.c
Author: tellison
Date: Fri Jan 6 08:27:36 2006
New Revision: 366523
URL: http://svn.apache.org/viewcvs?rev=366523&view=rev
Log:
Should not read the classpath from the properties file if it is being specific as a VM argument
Modified:
incubator/harmony/enhanced/classlib/trunk/native-src/linux.IA32/luni/luniglob.c
Modified: incubator/harmony/enhanced/classlib/trunk/native-src/linux.IA32/luni/luniglob.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/native-src/linux.IA32/luni/luniglob.c?rev=366523&r1=366522&r2=366523&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/native-src/linux.IA32/luni/luniglob.c (original)
+++ incubator/harmony/enhanced/classlib/trunk/native-src/linux.IA32/luni/luniglob.c Fri Jan 6 08:27:36 2006
@@ -61,6 +61,11 @@
void *keyInitCountPtr = GLOBAL_DATA (keyInitCount);
void **jclIdCache = GLOBAL_DATA (JCL_ID_CACHE);
jint rcBpInit;
+ VMInterface *vmInterface;
+ JavaVMInitArgs *vmArgs;
+ JavaVMOption *currentOption;
+ int i;
+ int bootClassPathSet = 0;
#if defined(LINUX)
/* all UNIX platforms */
@@ -68,6 +73,13 @@
HySigSet (SIGPIPE, SIG_IGN, previousGpHandler);
#endif
+ /* Query the VM interface */
+ vmInterface = VMI_GetVMIFromJavaVM (vm);
+ if (!vmInterface)
+ {
+ goto fail;
+ }
+
if ((*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_2) == JNI_OK)
{
PORT_ACCESS_FROM_ENV (env);
@@ -95,12 +107,33 @@
{
goto fail2;
}
-
- /* Initialize bootstrap classpath */
- rcBpInit = readClassPathFromPropertiesFile (vm);
- if (JNI_OK != rcBpInit)
+ /* Grab the VM command line arguments */
+ vmArgs = (*vmInterface)->GetInitArgs (vmInterface);
+ if (!vmArgs)
{
- goto fail2;
+ return JNI_ERR;
+ }
+
+ /* Before we try to set the bootclasspath, check that it has not been specified
+ explicitly on the command line */
+ for ( i = 0; i < vmArgs->nOptions; i++ )
+ {
+ currentOption = &(vmArgs->options[i]);
+ if ( strstr( currentOption->optionString, "-Xbootclasspath:" ) )
+ {
+ bootClassPathSet = 1;
+ }
+ }
+
+ /* Only read bootsclasspath.properties if -Xbootclasspath: has not been specified */
+ if (0 == bootClassPathSet)
+ {
+ /* Initialize bootstrap classpath */
+ rcBpInit = readClassPathFromPropertiesFile (vm);
+ if (JNI_OK != rcBpInit)
+ {
+ goto fail2;
+ }
}
return JNI_VERSION_1_2;