src/solaris/native/java/lang/java_props_macosx.c

Print this page

        

*** 143,173 **** if (isInAquaSession()) return pref = CToolkit; if (isXDisplayDefined()) return pref = XToolkit; return pref = HToolkit; } - void setUnknownOSAndVersion(java_props_t *sprops) { - sprops->os_name = strdup("Unknown"); - sprops->os_version = strdup("Unknown"); - } - void setOSNameAndVersion(java_props_t *sprops) { ! void *jrsFwk = getJRSFramework(); ! if (jrsFwk == NULL) { ! setUnknownOSAndVersion(sprops); ! return; ! } ! char *(*copyOSName)() = dlsym(jrsFwk, "JRSCopyOSName"); char *(*copyOSVersion)() = dlsym(jrsFwk, "JRSCopyOSVersion"); ! if (copyOSName == NULL || copyOSVersion == NULL) { ! setUnknownOSAndVersion(sprops); return; } ! ! sprops->os_name = copyOSName(); ! sprops->os_version = copyOSVersion(); } static Boolean getProxyInfoForProtocol(CFDictionaryRef inDict, CFStringRef inEnabledKey, CFStringRef inHostKey, CFStringRef inPortKey, CFStringRef *outProxyHost, int *ioProxyPort) { /* See if the proxy is enabled. */ --- 143,168 ---- if (isInAquaSession()) return pref = CToolkit; if (isXDisplayDefined()) return pref = XToolkit; return pref = HToolkit; } void setOSNameAndVersion(java_props_t *sprops) { ! /* Don't rely on JRSCopyOSName because there's no guarantee the value will ! * remain the same, or even if the JRS functions will continue to be part of ! * Mac OS X. So hardcode os_name, and fill in os_version if we can. ! */ ! sprops->os_name = strdup("Mac OS X"); ! void *jrsFwk = getJRSFramework(); ! if (jrsFwk != NULL) { char *(*copyOSVersion)() = dlsym(jrsFwk, "JRSCopyOSVersion"); ! if (copyOSVersion != NULL) { ! sprops->os_version = copyOSVersion(); return; } ! } ! sprops->os_version = strdup("Unknown"); } static Boolean getProxyInfoForProtocol(CFDictionaryRef inDict, CFStringRef inEnabledKey, CFStringRef inHostKey, CFStringRef inPortKey, CFStringRef *outProxyHost, int *ioProxyPort) { /* See if the proxy is enabled. */