~ubuntu-branches/ubuntu/maverick/rrdtool/maverick

« back to all changes in this revision

Viewing changes to debian/patches/bts332766-negative-timestamps

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2010-07-22 08:07:01 UTC
  • mfrom: (1.2.8 upstream) (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100722080701-k46mgdfz6euxwqsm
Tags: 1.4.3-1ubuntu1
* Merge from debian unstable, Remaining changes:
  - debian/control: Don't build against ruby1.9 as we don't want
    it in main.
* require libdbi >= 0.8.3 to prevent aborts when using dbi datasources

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff a/src/rrd_update.c b/src/rrd_update.c
2
 
--- a/src/rrd_update.c
3
 
+++ b/src/rrd_update.c
4
 
@@ -972,6 +972,11 @@ static int get_time_from_reading(
5
 
             return -1;
6
 
         };
7
 
         setlocale(LC_NUMERIC, old_locale);
8
 
+        if (tmp < 0.0){
9
 
+            gettimeofday(&tmp_time, 0);
10
 
+            tmp = (double)tmp_time.tv_sec + (double)tmp_time.tv_usec * 1e-6f + tmp;
11
 
+        }
12
 
+
13
 
         *current_time = floor(tmp);
14
 
         *current_time_usec = (long) ((tmp - (double) *current_time) * 1e6f);
15
 
     }