From: phk Date: Tue, 25 Sep 2007 10:32:24 +0000 (+0000) Subject: Make Tim_format() take a double time argument X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8baece3affa423c3ac21c7c0c60395c2020d8419;p=varnish Make Tim_format() take a double time argument git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2037 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/include/libvarnish.h b/varnish-cache/include/libvarnish.h index 6bac9eb9..cc618fe7 100644 --- a/varnish-cache/include/libvarnish.h +++ b/varnish-cache/include/libvarnish.h @@ -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); diff --git a/varnish-cache/lib/libvarnish/time.c b/varnish-cache/lib/libvarnish/time.c index f1ef97a5..d3a337ac 100644 --- a/varnish-cache/lib/libvarnish/time.c +++ b/varnish-cache/lib/libvarnish/time.c @@ -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); }