]> arthur.barton.de Git - netdata.git/commitdiff
reverted back the last tolerance fix - charts become anligned visually
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Mon, 14 Nov 2016 22:40:01 +0000 (00:40 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Mon, 14 Nov 2016 22:40:01 +0000 (00:40 +0200)
src/rrd.c

index a406476af34a6c8c1fa3701cf095df9a5d27adee..52de637bccf97c1b0bdd16a744ed4db030ccbf34 100644 (file)
--- a/src/rrd.c
+++ b/src/rrd.c
@@ -461,8 +461,8 @@ static inline long align_entries_to_pagesize(long entries) {
 }
 
 static inline void timeval_align(struct timeval *tv, int update_every) {
-    tv->tv_sec  = tv->tv_sec - tv->tv_sec % update_every + update_every / 2;
-    tv->tv_usec = (unsigned long)(update_every % 2) * 500000;
+    tv->tv_sec -= tv->tv_sec % update_every;
+    tv->tv_usec = 500000;
 }
 
 RRDSET *rrdset_create(const char *type, const char *id, const char *name, const char *family, const char *context, const char *title, const char *units, long priority, int update_every, int chart_type)