VTIM_real vs VTIM_mono / double vs uint64_t

Nils Goroll slink at schokola.de
Thu Apr 7 08:55:33 CEST 2016


stupid glitch: the patch had the wrong factor for gettimeofday seconds to
nanoseconds

diff --git a/lib/libvarnish/vtim.c b/lib/libvarnish/vtim.c
index e0f81bb..91a7531 100644
--- a/lib/libvarnish/vtim.c
+++ b/lib/libvarnish/vtim.c
@@ -125,7 +125,7 @@ VTIM_mono_i(void)
        struct timeval tv;

        AZ(gettimeofday(&tv, NULL));
-       return (tv.tv_sec * 1e6 + tv.tv_usec * 1e3);
+       return (tv.tv_sec * 1e9 + tv.tv_usec * 1e3);
 #endif
 }

@@ -157,7 +157,7 @@ VTIM_real_i(void)
        struct timeval tv;

        AZ(gettimeofday(&tv, NULL));
-       return (tv.tv_sec * 1e6 + tv.tv_usec * 1e3);
+       return (tv.tv_sec * 1e9 + tv.tv_usec * 1e3);
 #endif
 }




More information about the varnish-dev mailing list