Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/embryo
Dir : e17/libs/embryo/src/lib
Modified Files:
embryo_time.c
Log Message:
handle tz updates with localtime - limit calls to more than 1 second apart.
===================================================================
RCS file: /cvs/e/e17/libs/embryo/src/lib/embryo_time.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- embryo_time.c 11 Apr 2008 19:06:18 -0000 1.5
+++ embryo_time.c 13 May 2008 05:14:19 -0000 1.6
@@ -29,6 +29,7 @@
static Embryo_Cell
_embryo_time_date(Embryo_Program *ep, Embryo_Cell *params)
{
+ static time_t last_tzset = 0;
struct timeval timev;
struct tm *tm;
time_t tt;
@@ -36,6 +37,11 @@
if (params[0] != (8 * sizeof(Embryo_Cell))) return 0;
gettimeofday(&timev, NULL);
tt = (time_t)(timev.tv_sec);
+ if ((tt - last_tzset) < 1)
+ {
+ last_tzset = tt;
+ tzset();
+ }
tm = localtime(&tt);
if (tm)
{
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs