[4.0] ab252f0 Explicitly round down for timestamps

Lasse Karstensen lkarsten at varnish-software.com
Mon Sep 22 16:38:21 CEST 2014


commit ab252f042c612ac14384e09c437103489fb02ce3
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Jun 24 10:44:30 2014 +0000

    Explicitly round down for timestamps

diff --git a/lib/libvmod_std/vmod_std_conversions.c b/lib/libvmod_std/vmod_std_conversions.c
index 8ca0dd7..cdcd3cb 100644
--- a/lib/libvmod_std/vmod_std_conversions.c
+++ b/lib/libvmod_std/vmod_std_conversions.c
@@ -209,7 +209,7 @@ vmod_time2integer(const struct vrt_ctx *ctx, VCL_TIME t)
 {
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 
-	return (t);
+	return ((long)floor(t));
 }
 
 VCL_REAL __match_proto__(td_std_time2real)



More information about the varnish-commit mailing list