summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorJonathan Kew <jfkthame@googlemail.com>2006-12-21 12:35:39 +0000
committerJonathan Kew <jfkthame@googlemail.com>2006-12-21 12:35:39 +0000
commit9224ac02ef41b932a460edede965e4f3672f98de (patch)
treedf445e35fae85f4d46f3557edf7e3be2a1e5148a /Build
parentaebfda3e4d62174d4102d4252e843e17943fa1d9 (diff)
merged rev2831 from dvipdfmx into xdvipdfmx
git-svn-id: svn://tug.org/texlive/trunk@2836 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/xdvipdfmx/src/pdfdoc.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/Build/source/texk/xdvipdfmx/src/pdfdoc.c b/Build/source/texk/xdvipdfmx/src/pdfdoc.c
index 1a18c7beb74..87c4edf3ec6 100644
--- a/Build/source/texk/xdvipdfmx/src/pdfdoc.c
+++ b/Build/source/texk/xdvipdfmx/src/pdfdoc.c
@@ -484,6 +484,23 @@ pdf_doc_set_eop_content (const char *content, unsigned length)
return;
}
+/* auxiliary function to compute timezone offset on
+ systems that do not support the tm_gmtoff in struct tm,
+ or have a timezone variable. Such as i386-solaris. */
+
+static long
+compute_timezone_offset()
+{
+ const time_t now = time(NULL);
+ struct tm tm;
+ struct tm local;
+ time_t gmtoff;
+
+ localtime_r(&now, &local);
+ gmtime_r(&now, &tm);
+ return (mktime(&local) - mktime(&tm));
+}
+
/*
* Docinfo
*/
@@ -494,7 +511,7 @@ asn_date (char *date_string)
# ifdef HAVE_TM_GMTOFF
# define timezone (-bd_time->tm_gmtoff)
# else
-# define timezone 0l
+# define timezone (-compute_timezone_offset())
# endif /* not HAVE_TM_GMTOFF */
#endif /* not HAVE_TIMEZONE */
time_t current_time;