projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updates for tcl bindings by -- Dave Bodenstab <dave on bodenstab.org>
[rrdtool.git]
/
src
/
rrd_fetch.c
diff --git
a/src/rrd_fetch.c
b/src/rrd_fetch.c
index
93c6e93
..
e6590ec
100644
(file)
--- a/
src/rrd_fetch.c
+++ b/
src/rrd_fetch.c
@@
-1,5
+1,5
@@
/*****************************************************************************
/*****************************************************************************
- * RRDtool 1.2
rc5
Copyright by Tobi Oetiker, 1997-2005
+ * RRDtool 1.2
.11
Copyright by Tobi Oetiker, 1997-2005
*****************************************************************************
* rrd_fetch.c read date from an rrd to use for further processing
*****************************************************************************
*****************************************************************************
* rrd_fetch.c read date from an rrd to use for further processing
*****************************************************************************
@@
-75,6
+75,7
@@
rrd_fetch(int argc,
struct rrd_time_value start_tv, end_tv;
char *parsetime_error = NULL;
struct rrd_time_value start_tv, end_tv;
char *parsetime_error = NULL;
+ optind = 0; opterr = 0; /* initialize getopt */
/* init start and end time */
parsetime("end-24h", &start_tv);
/* init start and end time */
parsetime("end-24h", &start_tv);
@@
-181,12
+182,12
@@
rrd_fetch_fn(
int first_part = 1;
rrd_t rrd;
rrd_value_t *data_ptr;
int first_part = 1;
rrd_t rrd;
rrd_value_t *data_ptr;
- unsigned long rows
= (*end - *start) / *step
;
+ unsigned long rows;
#ifdef DEBUG
fprintf(stderr,"Entered rrd_fetch_fn() searching for the best match\n");
#ifdef DEBUG
fprintf(stderr,"Entered rrd_fetch_fn() searching for the best match\n");
-fprintf(stderr,"Looking for: start %10lu end %10lu step %5lu
rows %lu
\n",
- *start,*end,*step
,rows
);
+fprintf(stderr,"Looking for: start %10lu end %10lu step %5lu\n",
+ *start,*end,*step);
#endif
if(rrd_open(filename,&in_file,&rrd, RRD_READONLY)==-1)
#endif
if(rrd_open(filename,&in_file,&rrd, RRD_READONLY)==-1)
@@
-294,7
+295,7
@@
fprintf(stderr,"partial match, not best\n");
*step = rrd.stat_head->pdp_step * rrd.rra_def[chosen_rra].pdp_cnt;
*start -= (*start % *step);
if (*end % *step) *end += (*step - *end % *step);
*step = rrd.stat_head->pdp_step * rrd.rra_def[chosen_rra].pdp_cnt;
*start -= (*start % *step);
if (*end % *step) *end += (*step - *end % *step);
- rows = (*end - *start) / *step;
+ rows = (*end - *start) / *step
+ 1
;
#ifdef DEBUG
fprintf(stderr,"We found: start %10lu end %10lu step %5lu rows %lu\n",
#ifdef DEBUG
fprintf(stderr,"We found: start %10lu end %10lu step %5lu rows %lu\n",