--- jdk/src/solaris/native/java/lang/java_props_md.c.orig 2015-09-11 16:49:57 UTC +++ jdk/src/solaris/native/java/lang/java_props_md.c @@ -46,13 +46,6 @@ #include "java_props_macosx.h" #endif -#if defined(_ALLBSD_SOURCE) -#if !defined(P_tmpdir) -#include -#define P_tmpdir _PATH_VARTMP -#endif -#endif - #include "locale_str.h" #include "java_props.h" @@ -131,219 +124,84 @@ setPathEnvironment(char *envstring) } } -#ifndef P_tmpdir -#define P_tmpdir "/var/tmp" -#endif - static int ParseLocale(int cat, char ** std_language, char ** std_script, char ** std_country, char ** std_variant, char ** std_encoding) { char temp[64]; - char *language = NULL, *country = NULL, *variant = NULL, + char *script = NULL, *country = NULL, *variant = NULL, *encoding = NULL; - char *p, encoding_variant[64]; char *lc; /* Query the locale set for the category */ -#ifdef MACOSX - lc = setupMacOSXLocale(cat); // malloc'd memory, need to free -#else lc = setlocale(cat, NULL); -#endif -#if !defined(__linux__) && !defined(__OpenBSD__) - if (lc == NULL) { - return 0; - } - - if (cat == LC_CTYPE) { - /* - * Workaround for Solaris bug 4201684: Xlib doesn't like @euro - * locales. Since we don't depend on the libc @euro behavior, - * we just remove the qualifier. - * On Linux, the bug doesn't occur; on the other hand, @euro - * is needed there because it's a shortcut that also determines - * the encoding - without it, we wouldn't get ISO-8859-15. - * Therefore, this code section is Solaris-specific. - */ - lc = strdup(lc); /* keep a copy, setlocale trashes original. */ - strcpy(temp, lc); - p = strstr(temp, "@euro"); - if (p != NULL) { - *p = '\0'; - setlocale(LC_ALL, temp); - } - } -#else + *std_script = NULL; + *std_variant = NULL; + if (lc == NULL || !strcmp(lc, "C") || !strcmp(lc, "POSIX")) { - lc = "en_US"; + *std_language = malloc(strlen(bsd_language)+1); + strcpy(*std_language, bsd_language); + *std_country = malloc(strlen(bsd_country)+1); + strcpy(*std_country, bsd_country); + if (std_encoding != NULL) { + *std_encoding = malloc(strlen(bsd_encoding)+1); + strcpy(*std_encoding, bsd_encoding); + } + return 1; } -#endif /* - * locale string format in Solaris is - * _.@ - * , , and are optional. + * locale string format is either + * 1) _.@ + * 2) _