diff options
author | Andrew Niefer | 2009-07-20 20:43:57 +0000 |
---|---|---|
committer | Andrew Niefer | 2009-07-20 20:43:57 +0000 |
commit | 6c6dc201aa33b115be540848acc90021a63b8567 (patch) | |
tree | 0d2bfc90940e4bd3ca3ae433839006f60cc46dfc | |
parent | 3e6339a9d0c834689b1425f97f0ce9a6fbbde87f (diff) | |
download | rt.equinox.framework-6c6dc201aa33b115be540848acc90021a63b8567.tar.gz rt.equinox.framework-6c6dc201aa33b115be540848acc90021a63b8567.tar.xz rt.equinox.framework-6c6dc201aa33b115be540848acc90021a63b8567.zip |
bug 283475 - launching on solaris 9R35x_v20090720
3 files changed, 45 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseMozilla.c b/bundles/org.eclipse.equinox.executable/library/eclipseMozilla.c index 25035ff69..45a01d671 100644 --- a/bundles/org.eclipse.equinox.executable/library/eclipseMozilla.c +++ b/bundles/org.eclipse.equinox.executable/library/eclipseMozilla.c @@ -91,6 +91,40 @@ int filter(const struct dirent *dir) return 0; /* exclude from scandir result */ } +#if defined (SOLARIS) +/* + * A replacement for + * scandir(const char *dir, struct dirent ***namelist, filter, alphasort); + * because scandir & alphasort don't exist on Solaris 9. + * Return the dirent->d_name that was sorted the highest according to strcoll, + * or NULL on error or if no entries matched the filter. + * The caller is responsible for freeing the returned string + */ +char * scan(const char * path) { + DIR *dir = NULL; + struct dirent * entry = NULL; + char * candidate = NULL; + + if ((dir = opendir(path)) == NULL) { + return NULL; + } + + while ((entry = readdir(dir)) != NULL) { + if (filter(entry)) { + if (candidate == NULL) { + candidate = strdup(entry->d_name); + } else if (strcoll(candidate, entry->d_name) < 0) { + free(candidate); + candidate = strdup(entry->d_name); + } + } + } + closedir(dir); + + return candidate; +} +#endif + /* Set the environmnent required by the SWT Browser widget to bind to Mozilla. * The SWT Browser widget relies on Mozilla on Linux. The LD_LIBRARY_PATH * and the Mozilla environment variable MOZILLA_FIVE_HOME must point @@ -172,6 +206,10 @@ void fixEnvForMozilla() { #else char* dir = "/usr/lib/"; #endif +#if defined (SOLARIS) + char * name = scan(dir); + if (name != NULL) { +#else struct dirent **namelist; int i; int count = scandir(dir, &namelist, filter, alphasort); @@ -181,13 +219,18 @@ void fixEnvForMozilla() { * with the latest version number. */ char* name = namelist [count - 1]->d_name; +#endif grePath = malloc (strlen(dir) + strlen(name) + 1); strcpy(grePath, dir); strcat(grePath, name); +#if defined (SOLARIS) + free(name); +#else for (i = 0; i < count; i++) { free(namelist [i]); } free(namelist); +#endif } if (grePath == NULL) diff --git a/bundles/org.eclipse.equinox.launcher/contributed/org.eclipse.equinox.launcher.gtk.solaris.x86/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.launcher/contributed/org.eclipse.equinox.launcher.gtk.solaris.x86/META-INF/MANIFEST.MF index be1e9db11..ad02a5d76 100644 --- a/bundles/org.eclipse.equinox.launcher/contributed/org.eclipse.equinox.launcher.gtk.solaris.x86/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.launcher/contributed/org.eclipse.equinox.launcher.gtk.solaris.x86/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.equinox.launcher.gtk.solaris.x86;singleton:=true -Bundle-Version: 1.0.200.qualifier +Bundle-Version: 1.0.201.qualifier Fragment-Host: org.eclipse.equinox.launcher;bundle-version="[1.0.0,1.1.0)" Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=solaris) (osgi.arch=x86)) Bundle-Localization: launcher.gtk.solaris.x86 diff --git a/bundles/org.eclipse.equinox.launcher/fragments/org.eclipse.equinox.launcher.gtk.solaris.sparc/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.launcher/fragments/org.eclipse.equinox.launcher.gtk.solaris.sparc/META-INF/MANIFEST.MF index cceedfb38..73431fd96 100644 --- a/bundles/org.eclipse.equinox.launcher/fragments/org.eclipse.equinox.launcher.gtk.solaris.sparc/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.launcher/fragments/org.eclipse.equinox.launcher.gtk.solaris.sparc/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.equinox.launcher.gtk.solaris.sparc;singleton:=true -Bundle-Version: 1.0.200.qualifier +Bundle-Version: 1.0.201.qualifier Fragment-Host: org.eclipse.equinox.launcher;bundle-version="[1.0.0,1.1.0)" Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=solaris) (osgi.arch=sparc)) Bundle-Localization: launcher.gtk.solaris.sparc |