--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: Bugfixes for wmtz
- From: Narayanan R S <nars@kadamba.org>
- Date: Sat, 28 Mar 2009 22:57:06 +0530
- Message-id: <e4013ca30903281027p66a0f3dn5350a27d0304f89c@mail.gmail.com>
Package: wmtz
Version: 0.7-8
wmtz has an open bug related to incorrect daylight savings time zone
string changes [See: Bug# #166526]. wmtz doesn't take into account the
zone name changes [e.g: EST to EDT for Eastern Standard to Eastern
Daylight]. This is a bug in code and I'm including a patch below.
One more issue that I've addressed (which IMHO is a useful fix to
avoid too many wakeups) is the sleep interval. wmtz seems to sleep for
10000 microseconds (effectively resulting in 100 wakeups per second).
This can quite safely be upped to 100000 microseconds, reducing
wakeups to 10 per second (and correspondingly changing the response
latency to a worst case of 0.1s which is quite OK since the only
option is a simple menu click).
This has improved power savings quite a bit as well as my processor
goes remains in the lower C states for far longer.
The patch is roughly [this is a diff of the final files after applying
the debian specific patches as well]
----------------------------------------------------------------------------------
--- wmtz.c 2001-04-16 15:26:34.000000000 -0400
+++ wmtz.new 2009-03-28 13:20:09.240867000 -0400
@@ -51,8 +51,7 @@
#define STRSIZE 10
#define LMST 1
#define GMST 0
-#define ABOUT "xmessage -center -buttons \"Close\" \"WMTZ - Window
Maker Time Zone dockapp v0.7
-http://www.geocities.com/jl1n/wmtz/wmtz.html\""
+#define ABOUT "xmessage -center -buttons \"Close\" \"WMTZ - Window
Maker Time Zone dockapp
v0.7\nhttp://www.geocities.com/jl1n/wmtz/wmtz.html\""
/*
@@ -401,7 +400,10 @@
tzset();
clk = localtime(&curtime);
- strncpy(buf, tzname[0], 3);
+ // Obtain the Time Zone string
+ if (strftime(buf, sizeof(buf), "%Z", clk) == 0) {
+ strncpy(buf, tzname[0], 3);
+ }
for (k=0; k<3; k++)
if (buf[k] == 0)
@@ -478,11 +480,10 @@
}
but_stat = -1;
break;
- default:
}
}
- usleep(10000);
+ usleep(100000);
}
}
@@ -528,7 +529,6 @@
case 4:
exit(0);
break;
- default:
}
return;
}
----------------------------------------------------------------------------------
Please apply these fixes and confirm that the zone changes work.
Thanks.
Narayanan.
--- End Message ---