]> err.no Git - varnish/commitdiff
Make Tim_format() take a double time argument
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 25 Sep 2007 10:32:24 +0000 (10:32 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 25 Sep 2007 10:32:24 +0000 (10:32 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2037 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/include/libvarnish.h
varnish-cache/lib/libvarnish/time.c

index 6bac9eb9d286f22fe54cc469e1ce2a9c5378f8a3..cc618fe7ecdbbbf489dca93f99bc6a5f14648da0 100644 (file)
@@ -46,7 +46,7 @@ uint32_t crc32(uint32_t crc, const void *p1, unsigned l);
 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);
index f1ef97a50b69ea38ea93125108750d5b3788d98e..d3a337ac82884cb7cc2207931ff8d85cd98f114d 100644 (file)
@@ -87,11 +87,13 @@ TIM_real(void)
 }
 
 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);
 }