Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Sep 2021 09:39:14 -0700
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        Edward Tomasz Napierala <trasz@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: ddedf2a11eb2 - main - tzcode: Implement timezone change detection
Message-ID:  <59a39614-45d2-d9b0-a84a-476e52a81c76@FreeBSD.org>
In-Reply-To: <202109131442.18DEgDIn043709@gitrepo.freebsd.org>
References:  <202109131442.18DEgDIn043709@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--wSgEHqHSqGi1wIEqfMGgf01N8RK7YaRGw
Content-Type: multipart/mixed; boundary="U0hUOraZIKiLM0PKAMawQq5Vp3r1t51sj";
 protected-headers="v1"
From: Bryan Drewery <bdrewery@FreeBSD.org>
To: Edward Tomasz Napierala <trasz@FreeBSD.org>, src-committers@FreeBSD.org,
 dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Message-ID: <59a39614-45d2-d9b0-a84a-476e52a81c76@FreeBSD.org>
Subject: Re: git: ddedf2a11eb2 - main - tzcode: Implement timezone change
 detection
References: <202109131442.18DEgDIn043709@gitrepo.freebsd.org>
In-Reply-To: <202109131442.18DEgDIn043709@gitrepo.freebsd.org>

--U0hUOraZIKiLM0PKAMawQq5Vp3r1t51sj
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 9/13/2021 7:42 AM, Edward Tomasz Napierala wrote:
> +#else /* !DETECT_TZ_CHANGES */
> +#define	change_in_tz(X)	0

WITHOUT_DETECT_TZ_CHANGES: change_in_tz() =3D=3D 0

> +#endif /* !DETECT_TZ_CHANGES */
> +
>  static int
>  differ_by_repeat(const time_t t1, const time_t t0)
>  {
> @@ -379,6 +418,7 @@ register const int	doextend;
>  	int		stored;
>  	int		nread;
>  	int		res;
> +	int		ret;
>  	union {
>  		struct tzhead	tzhead;
>  		char		buf[2 * sizeof(struct tzhead) +
> @@ -427,6 +467,22 @@ register const int	doextend;
>  			(void) strcat(fullname, name);
>  			name =3D fullname;
>  		}
> +		if (doextend =3D=3D TRUE) {
> +			/*
> +			 * Detect if the timezone file has changed.  Check
> +			 * 'doextend' to ignore TZDEFRULES; the change_in_tz()
> +			 * function can only keep state for a single file.
> +			 */
> +			ret =3D change_in_tz(name);
> +			if (ret <=3D 0) {

WITHOUT_DETECT_TZ_CHANGES: Always returns a false-positive "done" but
short-circuits the rest of tzload().

> +				/*
> +				 * Returns -1 if there was an error,
> +				 * and 0 if the timezone had not changed.
> +				 */
> +				free(fullname);
> +				return ret;
> +			}
> +		}


--=20
Regards,
Bryan Drewery


--U0hUOraZIKiLM0PKAMawQq5Vp3r1t51sj--

--wSgEHqHSqGi1wIEqfMGgf01N8RK7YaRGw
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsB5BAABCAAjFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAmFA0DIFAwAAAAAACgkQNddxu25Gl88r
hAgAltyUu1Bn2s6N+Vg0AHDgThsClWA1Fq7nmTu+45BSqIilAMUQk7Uf/CvdfxAU1u658fGPhnYp
t25/fxRF4hDvyO0dN/Rmlbqx7HGInLYH6+HVPC+1SxTapR5mR54O8DxCOqVaF7wn5/tZXAQoVcZw
Alzsc+/aIlhlsthPjiX/6utjdGaDawLJaf6ugEWNHJncQmY7UN/8u3kbqstw+V6Kd8rQikgoO+8s
zx/4ABf1/vGylOK1JsisDCdM5buRbjU98B5E1uspXmdNzP8PDoknLXRDcgeX+Fs1sggL1pabrdrb
OT9K74mDkG/GqSPMs2hJfrxNSCz8zfknP7Jb45My0g==
=XIeD
-----END PGP SIGNATURE-----

--wSgEHqHSqGi1wIEqfMGgf01N8RK7YaRGw--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?59a39614-45d2-d9b0-a84a-476e52a81c76>