]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 723 - On some OS/distributions, hfaxd timezone handling is incorrect
authorAidan Van Dyk <aidan@ifax.com>
Fri, 24 Mar 2006 16:06:11 +0000 (16:06 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Fri, 24 Mar 2006 16:06:11 +0000 (16:06 +0000)
On newer GLIBC, they *always* check /etc/localtime for timzone information
if TZ isn't set.  Older distros cache the localtime information.  If TZ isn't
set, we'll set it here before entering out chroot (where /etc/localtime
isn't available).

CHANGES
hfaxd/HylaFAXServer.c++

diff --git a/CHANGES b/CHANGES
index 6248abc1fc04f7a4b09b548a0ab39b7bfd5376b3..d6978c6a580595032cc1dab18b8d18ae15c5040c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@
 
 Changelog
 
+* Fix hfaxd timezone handling on new GLIBC (BUG 723) (24 Mar 2006)
 * Fix locking of recvq tiff files (BUG 739) (23 Mar 2006)
 * fix batching of page jobs (23 Mar 2006)
 * expand Class1JBIGSupport to allow for differentiation
index 7788b494f5c15704034300414ead6b6d470eaede..dd4914a52eb16a898a5fd2f722f27963cccf129f 100644 (file)
@@ -98,6 +98,12 @@ HylaFAXServer::HylaFAXServer()
     tzname[1] = NULL;
 #endif
 
+    // Latest glibc will revert to UTC in the chroot if it can't
+    // find the zoneinfo file and no TZ is set in the environment.
+    fxStr tz = fxStr::format("%s%d:%02d%s", tzname[0], (gmtoff / 3600),
+               ((gmtoff / 60) % 60), tzname[1]);
+    setenv("TZ", tz, 0);
+
     cachedTIFF = NULL;
 }