summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e395d38)
raw | patch | inline | side by side (parent: e395d38)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 2 Jun 2009 16:10:07 +0000 (18:10 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 2 Jun 2009 16:10:07 +0000 (18:10 +0200) |
This is an upstream patch to fix the handling of negative timestamps in
rrdupdate(1). Thanks to Frank Zacharias for reporting this.
Closes: #332766
rrdupdate(1). Thanks to Frank Zacharias for reporting this.
Closes: #332766
debian/changelog | patch | blob | history | |
debian/patches/bts332766-negative-timestamps | [new file with mode: 0644] | patch | blob |
debian/patches/series | patch | blob | history |
diff --git a/debian/changelog b/debian/changelog
index 74a3c4fef20249bf3f6843e871cebac21bbb4037..bdc5837135e98d26b6a6e9daf26e949cbf95b6b1 100644 (file)
--- a/debian/changelog
+++ b/debian/changelog
- Added bts530814-hurd to fix a FTBFS on Hurd, thanks to Marc Dequènes for
reporting this and providing a patch (Closes: #530814).
- Removed doc-fixes - applied upstream.
+ - Added bts332766-negative-timestamps - upstream patch to fix the handling
+ of negative timestamps in rrdupdate(1), thanks to Frank Zacharias for
+ reporting this (Closes: #332766).
* debian/control:
- Removed transitional package "python-rrd" which is no longer required.
- Let rrdtool-dbg depend on ${shlibs:Depends}.
- Build Python dbg modules into rrdtool-dbg. Add necessary
(build-) dependencies.
- -- Sebastian Harl <tokkee@debian.org> Mon, 01 Jun 2009 14:13:53 +0200
+ -- Sebastian Harl <tokkee@debian.org> Mon, 01 Jun 2009 18:49:13 +0200
rrdtool (1.3.7-1) unstable; urgency=low
diff --git a/debian/patches/bts332766-negative-timestamps b/debian/patches/bts332766-negative-timestamps
--- /dev/null
@@ -0,0 +1,15 @@
+diff a/src/rrd_update.c b/src/rrd_update.c
+--- a/src/rrd_update.c
++++ b/src/rrd_update.c
+@@ -972,6 +972,11 @@ static int get_time_from_reading(
+ return -1;
+ };
+ setlocale(LC_NUMERIC, old_locale);
++ if (tmp < 0.0){
++ gettimeofday(&tmp_time, 0);
++ tmp = (double)tmp_time.tv_sec + (double)tmp_time.tv_usec * 1e-6f + tmp;
++ }
++
+ *current_time = floor(tmp);
+ *current_time_usec = (long) ((tmp - (double) *current_time) * 1e6f);
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 9f5c29fe5e4e088b2d9e8bb2688700a76a713354..93f905b5073ca4fc3f7064e13d5462b719c2e1f9 100644 (file)
--- a/debian/patches/series
+++ b/debian/patches/series
implicit-decl-fix
compiler-warning-fixes
bts530814-hurd
+bts332766-negative-timestamps