From: Sebastian Harl Date: Tue, 2 Jun 2009 16:10:07 +0000 (+0200) Subject: patches: Added bts332766-negative-timestamps. X-Git-Tag: debian/1.3.8-1^0 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3cd6f9c66357923b3d8c0376d15d7d3082807a83;p=pkg-rrdtool.git patches: Added bts332766-negative-timestamps. This is an upstream patch to fix the handling of negative timestamps in rrdupdate(1). Thanks to Frank Zacharias for reporting this. Closes: #332766 --- diff --git a/debian/changelog b/debian/changelog index 74a3c4f..bdc5837 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ rrdtool (1.3.8-1) unstable; urgency=low - 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}. @@ -18,7 +21,7 @@ rrdtool (1.3.8-1) unstable; urgency=low - Build Python dbg modules into rrdtool-dbg. Add necessary (build-) dependencies. - -- Sebastian Harl Mon, 01 Jun 2009 14:13:53 +0200 + -- Sebastian Harl 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 new file mode 100644 index 0000000..9ae9a15 --- /dev/null +++ b/debian/patches/bts332766-negative-timestamps @@ -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 9f5c29f..93f905b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -6,3 +6,4 @@ no-rpath-for-perl implicit-decl-fix compiler-warning-fixes bts530814-hurd +bts332766-negative-timestamps