aboutsummaryrefslogtreecommitdiffstats
path: root/x11-clocks/wmclockmon/files
diff options
context:
space:
mode:
authorshaun <shaun@FreeBSD.org>2006-07-19 04:56:24 +0800
committershaun <shaun@FreeBSD.org>2006-07-19 04:56:24 +0800
commit5e798f48504aa591b4559d13acc66f9e0b4193d2 (patch)
treecf653aba4905fdef35d57807511f0314538caa3a /x11-clocks/wmclockmon/files
parentc2a8f67d35f2e72d8adda919fc005a14af9909ff (diff)
downloadfreebsd-ports-gnome-5e798f48504aa591b4559d13acc66f9e0b4193d2.tar.gz
freebsd-ports-gnome-5e798f48504aa591b4559d13acc66f9e0b4193d2.tar.zst
freebsd-ports-gnome-5e798f48504aa591b4559d13acc66f9e0b4193d2.zip
Fix Internet time calculation.
PR: ports/86334 Submitted by: Frank Altpeter <frank@altpeter.de> Patched by: shaun (me), Soeren Straarup <xride@x12.dk> (maintainer) Approved by: ahze (mentor, implicit)
Diffstat (limited to 'x11-clocks/wmclockmon/files')
-rw-r--r--x11-clocks/wmclockmon/files/patch-src_main.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/x11-clocks/wmclockmon/files/patch-src_main.c b/x11-clocks/wmclockmon/files/patch-src_main.c
new file mode 100644
index 000000000000..d52006326a27
--- /dev/null
+++ b/x11-clocks/wmclockmon/files/patch-src_main.c
@@ -0,0 +1,33 @@
+--- src/main.c.orig Thu Apr 7 11:37:43 2005
++++ src/main.c Tue Jul 18 22:20:25 2006
+@@ -51,7 +51,7 @@
+ #define FREE(data) {if (data) free(data); data = NULL;}
+ #define SET_STRING(str, val) {if (str) free(str); str = xstrdup(val);}
+
+-#if defined(netbsd) || defined(openbsd) || defined(freebsd) || defined(darwin)
++#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__APPLE__)
+ # define BSDTIMEZONE
+ #endif
+
+@@ -1270,10 +1270,10 @@
+ time_t tnow;
+
+ time(&tnow);
+- timeinfos = localtime(&tnow);
+
+ if (time_mode == INTERNET) {
+ long localtmzone;
++ timeinfos = gmtime(&tnow);
+ swtime = timeinfos->tm_hour * 3600
+ + timeinfos->tm_min * 60
+ + timeinfos->tm_sec;
+@@ -1290,6 +1290,9 @@
+ swtime -= 1000;
+ else
+ if (swtime < 0) swtime += 1000;
++ }
++ else {
++ timeinfos = localtime(&tnow);
+ }
+ }
+