r2037 - in trunk/varnish-cache: include lib/libvarnish
phk at projects.linpro.no
phk at projects.linpro.no
Tue Sep 25 12:32:24 CEST 2007
Author: phk
Date: 2007-09-25 12:32:24 +0200 (Tue, 25 Sep 2007)
New Revision: 2037
Modified:
trunk/varnish-cache/include/libvarnish.h
trunk/varnish-cache/lib/libvarnish/time.c
Log:
Make Tim_format() take a double time argument
Modified: trunk/varnish-cache/include/libvarnish.h
===================================================================
--- trunk/varnish-cache/include/libvarnish.h 2007-09-25 10:25:51 UTC (rev 2036)
+++ trunk/varnish-cache/include/libvarnish.h 2007-09-25 10:32:24 UTC (rev 2037)
@@ -46,7 +46,7 @@
uint32_t crc32_l(const void *p1, unsigned l);
/* from libvarnish/time.c */
-void TIM_format(time_t t, char *p);
+void TIM_format(double t, char *p);
time_t TIM_parse(const char *p);
double TIM_mono(void);
double TIM_real(void);
Modified: trunk/varnish-cache/lib/libvarnish/time.c
===================================================================
--- trunk/varnish-cache/lib/libvarnish/time.c 2007-09-25 10:25:51 UTC (rev 2036)
+++ trunk/varnish-cache/lib/libvarnish/time.c 2007-09-25 10:32:24 UTC (rev 2037)
@@ -87,11 +87,13 @@
}
void
-TIM_format(time_t t, char *p)
+TIM_format(double t, char *p)
{
struct tm tm;
+ time_t tt;
- gmtime_r(&t, &tm);
+ tt = (time_t) t;
+ gmtime_r(&tt, &tm);
strftime(p, 30, "%a, %d %b %Y %T GMT", &tm);
}
More information about the varnish-commit
mailing list