/hg/icedtea6: RH995488: Java thinks that the default timezone is...

Jiri Vanek jvanek at redhat.com
Thu Sep 5 23:43:06 PDT 2013


Offlist

As we agreed that this is not good patch and is rhel6 specific, is it really good idea to push it to 
icedtea?

On 09/05/2013 08:36 PM, andrew at icedtea.classpath.org wrote:
> changeset 0dbdbf696a34 in /hg/icedtea6
> details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=0dbdbf696a34
> author: Andrew John Hughes <gnu.andrew at redhat.com>
> date: Thu Sep 05 19:36:32 2013 +0100
>
> 	RH995488: Java thinks that the default timezone is Busingen instead of Zurich
>
> 	2013-09-05  Andrew John Hughes  <gnu.andrew at redhat.com>
>
> 		* Makefile.am:
> 		(ICEDTEA_PATCHES): Add new patch.
> 		* patches/rh995488-rhel_tz_fix.patch:
> 		Use /etc/sysconfig/clock on RHEL & clones
> 		so that they don't search /usr/share/zoneinfo.
> 		* NEWS: Mention patch.
>
>
> diffstat:
>
>   ChangeLog                          |   9 ++++
>   Makefile.am                        |   3 +-
>   NEWS                               |   1 +
>   patches/rh995488-rhel_tz_fix.patch |  77 ++++++++++++++++++++++++++++++++++++++
>   4 files changed, 89 insertions(+), 1 deletions(-)
>
> diffs (121 lines):
>
> diff -r 782a87f782f3 -r 0dbdbf696a34 ChangeLog
> --- a/ChangeLog	Mon Sep 02 20:59:15 2013 +0100
> +++ b/ChangeLog	Thu Sep 05 19:36:32 2013 +0100
> @@ -1,3 +1,12 @@
> +2013-09-05  Andrew John Hughes  <gnu.andrew at redhat.com>
> +
> +	* Makefile.am:
> +	(ICEDTEA_PATCHES): Add new patch.
> +	* patches/rh995488-rhel_tz_fix.patch:
> +	Use /etc/sysconfig/clock on RHEL & clones
> +	so that they don't search /usr/share/zoneinfo.
> +	* NEWS: Mention patch.
> +
>   2013-09-02  Andrew John Hughes  <gnu.andrew at redhat.com>
>
>   	* Makefile.am:
> diff -r 782a87f782f3 -r 0dbdbf696a34 Makefile.am
> --- a/Makefile.am	Mon Sep 02 20:59:15 2013 +0100
> +++ b/Makefile.am	Thu Sep 05 19:36:32 2013 +0100
> @@ -760,7 +760,8 @@
>   	patches/openjdk/6980281-majorver_for_solaris.patch \
>   	patches/openjdk/7000225-bad_tabs.patch \
>   	patches/openjdk/7038711-fix_no-clobber_usage.patch \
> -	patches/disable-cc-incompatible-sanity-checks.patch
> +	patches/disable-cc-incompatible-sanity-checks.patch \
> +	patches/rh995488-rhel_tz_fix.patch
>
>   if WITH_ALT_HSBUILD
>   ICEDTEA_PATCHES += \
> diff -r 782a87f782f3 -r 0dbdbf696a34 NEWS
> --- a/NEWS	Mon Sep 02 20:59:15 2013 +0100
> +++ b/NEWS	Thu Sep 05 19:36:32 2013 +0100
> @@ -46,6 +46,7 @@
>     - RH902004: very bad performance with E-Porto Add-In für OpenOffice Writer installed (hs23 only)
>     - RH991170: java does not use correct kerberos credential cache
>     - PR1535: Allow use of system Kerberos to obtain cache location
> +  - RH995488: Java thinks that the default timezone is Busingen instead of Zurich
>   * JamVM
>     - JSR 335: Lambda Expressions
>     - JEP 171: Implement fence methods in sun.misc.Unsafe
> diff -r 782a87f782f3 -r 0dbdbf696a34 patches/rh995488-rhel_tz_fix.patch
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/patches/rh995488-rhel_tz_fix.patch	Thu Sep 05 19:36:32 2013 +0100
> @@ -0,0 +1,77 @@
> +diff --git a/src/solaris/native/java/util/TimeZone_md.c b/src/solaris/native/java/util/TimeZone_md.c
> +--- openjdk/jdk/src/solaris/native/java/util/TimeZone_md.c
> ++++ openjdk/jdk/src/solaris/native/java/util/TimeZone_md.c
> +@@ -52,6 +52,8 @@
> + #ifdef __linux__
> +
> + static const char *ETC_TIMEZONE_FILE = "/etc/timezone";
> ++static const char *REDHAT_RELEASE_FILE = "/etc/redhat-release";
> ++static const char *SYSCONFIG_CLOCK_FILE = "/etc/sysconfig/clock";
> + static const char *ZONEINFO_DIR = "/usr/share/zoneinfo";
> + static const char *DEFAULT_ZONEINFO_FILE = "/etc/localtime";
> +
> +@@ -225,6 +227,64 @@
> +     }
> +
> +     /*
> ++     * Next, try the ZONE entry in /etc/sysconfig/clock.
> ++     */
> ++    if ((fp = fopen(REDHAT_RELEASE_FILE, "r")) != NULL) {
> ++	char id[7];
> ++
> ++	/* Avoid this file on Fedora as may be buggy; RH489586 */
> ++	if (fgets(id, sizeof (id), fp) != NULL &&
> ++	  strncmp(id, "Fedora", 6) != 0) {
> ++	    (void) fclose(fp);
> ++	    if ((fp = fopen(SYSCONFIG_CLOCK_FILE, "r")) != NULL) {
> ++		char line[256];
> ++		
> ++		while (fgets(line, sizeof(line), fp) != NULL) {
> ++		    char *p = line;
> ++		    char *s;
> ++		
> ++		    SKIP_SPACE(p);
> ++		    if (*p != 'Z') {
> ++			continue;
> ++		    }
> ++		    if (strncmp(p, "ZONE=\"", 6) == 0) {
> ++			p += 6;
> ++		    } else {
> ++			/*
> ++			 * In case we need to parse it token by token.
> ++			 */
> ++			if (strncmp(p, "ZONE", 4) != 0) {
> ++			    continue;
> ++			}
> ++			p += 4;
> ++			SKIP_SPACE(p);
> ++			if (*p++ != '=') {
> ++			    break;
> ++			}
> ++			SKIP_SPACE(p);
> ++			if (*p++ != '"') {
> ++			    break;
> ++			}
> ++		    }
> ++		    for (s = p; *s && *s != '"'; s++)
> ++			;
> ++		    if (*s != '"') {
> ++			/* this ZONE entry is broken. */
> ++			break;
> ++		    }
> ++		    *s = '\0';
> ++		    tz = strdup(p);
> ++		    break;
> ++		}
> ++		(void) fclose(fp);
> ++		if (tz != NULL) {
> ++		    return tz;
> ++		}
> ++	    }
> ++	}
> ++    }
> ++
> ++    /*
> +      * Next, try /etc/localtime to find the zone ID.
> +      */
> +     if (lstat(DEFAULT_ZONEINFO_FILE, &statbuf) == -1) {
>




More information about the distro-pkg-dev mailing list