projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
consider fgets return value
[rrdtool.git]
/
src
/
rrd_update.c
diff --git
a/src/rrd_update.c
b/src/rrd_update.c
index
5c60702
..
0c34743
100644
(file)
--- 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);
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);
}
*current_time = floor(tmp);
*current_time_usec = (long) ((tmp - (double) *current_time) * 1e6f);
}
@@
-1896,7
+1901,7
@@
static int write_to_rras(
scratch_idx = CDP_secondary_val,
step_subtract = 2) {
scratch_idx = CDP_secondary_val,
step_subtract = 2) {
-
off
_t rra_pos_new;
+
size
_t rra_pos_new;
#ifdef DEBUG
fprintf(stderr, " -- RRA Preseek %ld\n", rrd_file->pos);
#endif
#ifdef DEBUG
fprintf(stderr, " -- RRA Preseek %ld\n", rrd_file->pos);
#endif