Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Thondapu2015-01-27 17:27:21 +0000
committerArun Thondapu2015-01-27 17:31:17 +0000
commite2c7e75a3c7029bdfdb129c0ff7ed68edfe36677 (patch)
tree96d7eb367638dd86ec0b355fb064958488001437 /features/org.eclipse.equinox.executable.feature
parent1aea8dc45282dc32e96608c465c30761feb1d268 (diff)
downloadrt.equinox.framework-e2c7e75a3c7029bdfdb129c0ff7ed68edfe36677.tar.gz
rt.equinox.framework-e2c7e75a3c7029bdfdb129c0ff7ed68edfe36677.tar.xz
rt.equinox.framework-e2c7e75a3c7029bdfdb129c0ff7ed68edfe36677.zip
Bug 458558 - [1.9] --launcher.XXMaxPermSize should not pass
-XX:MaxPermSize= for Oracle VMs >= 8 Change-Id: If930c83b63af879e0edd31713f9bcc75a62efa87 Signed-off-by: Arun Thondapu <arunkumar.thondapu@in.ibm.com>
Diffstat (limited to 'features/org.eclipse.equinox.executable.feature')
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/carbon/eclipseCarbon.c8
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/eclipseNix.c11
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/eclipseUnicode.h1
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c24
4 files changed, 30 insertions, 14 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/carbon/eclipseCarbon.c b/features/org.eclipse.equinox.executable.feature/library/carbon/eclipseCarbon.c
index 500311abb..a158f64b0 100644
--- a/features/org.eclipse.equinox.executable.feature/library/carbon/eclipseCarbon.c
+++ b/features/org.eclipse.equinox.executable.feature/library/carbon/eclipseCarbon.c
@@ -533,8 +533,12 @@ char * getJavaVersion(char* command) {
}
if (strstr(buffer, "Java HotSpot(TM)") || strstr(buffer, "OpenJDK")) {
if (version != NULL) {
- if (version[0] == '1' && ((int)(version[2] - '0') < 8)) {
- isSunMaxPermSizeVM = 1;
+ _TCHAR *value = strtok(version, ".");
+ if (value != NULL && (strtol(value, NULL, 10) == 1)) {
+ value = strtok(NULL, ".");
+ if (strtol(value, NULL, 10) < 8) {
+ result = 1;
+ }
}
}
break;
diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipseNix.c b/features/org.eclipse.equinox.executable.feature/library/eclipseNix.c
index a4439c752..c6062b258 100644
--- a/features/org.eclipse.equinox.executable.feature/library/eclipseNix.c
+++ b/features/org.eclipse.equinox.executable.feature/library/eclipseNix.c
@@ -175,6 +175,9 @@ JavaResults* startJavaVM( _TCHAR* libPath, _TCHAR* vmArgs[], _TCHAR* progArgs[],
}
int isMaxPermSizeVM( _TCHAR * javaVM, _TCHAR * jniLib ) {
+ if (javaVM == NULL) {
+ return 0;
+ }
FILE *fp = NULL;
_TCHAR buffer[4096];
_TCHAR *version = NULL, *firstChar;
@@ -199,8 +202,12 @@ int isMaxPermSizeVM( _TCHAR * javaVM, _TCHAR * jniLib ) {
}
if (_tcsstr(buffer, "Java HotSpot(TM)") || _tcsstr(buffer, "OpenJDK")) {
if (version != NULL) {
- if (version[0] == '1' && ((int)(version[2] - '0') < 8)) {
- result = 1;
+ _TCHAR *value = _tcstok(version, ".");
+ if (value != NULL && (_tcstol(value, NULL, 10) == 1)) {
+ value = _tcstok(NULL, ".");
+ if (_tcstol(value, NULL, 10) < 8) {
+ result = 1;
+ }
}
}
break;
diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipseUnicode.h b/features/org.eclipse.equinox.executable.feature/library/eclipseUnicode.h
index f98b77dc7..6d758b9b1 100644
--- a/features/org.eclipse.equinox.executable.feature/library/eclipseUnicode.h
+++ b/features/org.eclipse.equinox.executable.feature/library/eclipseUnicode.h
@@ -96,6 +96,7 @@
#define _tgetcwd getcwd
#define _tgetenv getenv
#define _tcstol strtol
+#define _tcstok strtok
#ifndef LINUX
#define _totupper toupper
#endif /* LINUX */
diff --git a/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c b/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c
index e93388257..cd8806732 100644
--- a/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c
+++ b/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c
@@ -78,6 +78,7 @@ typedef struct {
} TRANSLATIONS;
#define COMPANY_NAME_KEY _T_ECLIPSE("\\StringFileInfo\\%04x%04x\\CompanyName")
+#define PRODUCT_VERSION_KEY _T_ECLIPSE("\\StringFileInfo\\%04x%04x\\ProductVersion")
#define SUN_MICROSYSTEMS _T_ECLIPSE("Sun Microsystems")
#define ORACLE _T_ECLIPSE("Oracle")
@@ -584,9 +585,9 @@ int isMaxPermSizeVM( _TCHAR * javaVM, _TCHAR * jniLib ) {
DWORD handle;
void * info;
- _TCHAR * key, *value;
+ _TCHAR *key, *value, *versionKey, *version;
size_t i;
- int valueSize;
+ int valueSize, versionSize;
if (vm == NULL)
return 0;
@@ -598,22 +599,25 @@ int isMaxPermSizeVM( _TCHAR * javaVM, _TCHAR * jniLib ) {
TRANSLATIONS * translations;
int translationsSize;
VerQueryValue(info, _T_ECLIPSE("\\VarFileInfo\\Translation"), (void *) &translations, &translationsSize);
-
+
/* this size is only right because %04x is 4 characters */
- key = malloc( (_tcslen(COMPANY_NAME_KEY) + 1) * sizeof(_TCHAR));
+ key = malloc((_tcslen(COMPANY_NAME_KEY) + 1) * sizeof(_TCHAR));
+ versionKey = malloc((_tcslen(PRODUCT_VERSION_KEY) + 1) * sizeof(_TCHAR));
for (i = 0; i < (translationsSize / sizeof(TRANSLATIONS)); i++) {
_stprintf(key, COMPANY_NAME_KEY, translations[i].language, translations[i].codepage);
-
VerQueryValue(info, key, (void *)&value, &valueSize);
- if (_tcsncmp(value, SUN_MICROSYSTEMS, _tcslen(SUN_MICROSYSTEMS)) == 0) {
- result = 1;
- break;
- } else if (_tcsncmp(value, ORACLE, _tcslen(ORACLE)) == 0) {
- result = 1;
+
+ if ((_tcsncmp(value, SUN_MICROSYSTEMS, _tcslen(SUN_MICROSYSTEMS)) == 0) || (_tcsncmp(value, ORACLE, _tcslen(ORACLE)) == 0)) {
+ _stprintf(versionKey, PRODUCT_VERSION_KEY, translations[i].language, translations[i].codepage);
+ VerQueryValue(info, versionKey, (void *)&version, &versionSize);
+ if ((version[0] - '0') < 8) {
+ result = 1;
+ }
break;
}
}
free(key);
+ free(versionKey);
}
free(info);
}

Back to the top