Mailing List Archive

r1786 - trunk/varnish-cache/bin/varnishd
Author: des
Date: 2007-07-30 15:54:48 +0200 (Mon, 30 Jul 2007)
New Revision: 1786

Modified:
trunk/varnish-cache/bin/varnishd/varnishd.c
Log:
Explicitly set TZ to GMT.


Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c 2007-07-30 13:50:16 UTC (rev 1785)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c 2007-07-30 13:54:48 UTC (rev 1786)
@@ -387,6 +387,9 @@
setbuf(stdout, NULL);
setbuf(stderr, NULL);

+ setenv("TZ", "GMT", 1);
+ tzset();
+
memset(cli, 0, sizeof cli);
cli[0].sb = vsb_new(NULL, NULL, 0, VSB_AUTOEXTEND);
XXXAN(cli[0].sb);
r1786 - trunk/varnish-cache/bin/varnishd [ In reply to ]
In message <20070730135448.E14DB1EC2A3 at projects.linpro.no>, des at projects.linpro.no writes:
>Author: des
>Date: 2007-07-30 15:54:48 +0200 (Mon, 30 Jul 2007)
>New Revision: 1786
>
>Modified:
> trunk/varnish-cache/bin/varnishd/varnishd.c
>Log:
>Explicitly set TZ to GMT.

I am not happy about this, it forces all timestamps we may generate,
including syslog &c to be GMT.

We should only use this hack on deficient OS's.

btw: on sysV derivatives, check libbsd.

>+ setenv("TZ", "GMT", 1);
>+ tzset();
>+

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
r1786 - trunk/varnish-cache/bin/varnishd [ In reply to ]
"Poul-Henning Kamp" <phk at phk.freebsd.dk> writes:
> "Dag-Erling Sm?rgrav" <des at projects.linpro.no> writes:
> > Explicitly set TZ to GMT.
> I am not happy about this, it forces all timestamps we may generate,
> including syslog &c to be GMT.

No, syslog timestamps are generated by syslogd(8).

time.c already assumes that all timestamps it handles are in GMT.

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no