projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
win32 portability patch and win32/rrdlib.vcproj file for the source
[rrdtool.git]
/
src
/
rrd_fetch.c
diff --git
a/src/rrd_fetch.c
b/src/rrd_fetch.c
index
d821dfa
..
abfe66c
100644
(file)
--- a/
src/rrd_fetch.c
+++ b/
src/rrd_fetch.c
@@
-235,6
+235,15
@@
int rrd_fetch_fn(
*start, *end, *step);
#endif
*start, *end, *step);
#endif
+#ifdef HAVE_LIBDBI
+ /* handle libdbi datasources */
+ if (strncmp("sql",filename,3)==0) {
+ if (filename[3]==filename[4]) {
+ return rrd_fetch_fn_libdbi(filename,cf_idx,start,end,step,ds_cnt,ds_namv,data);
+ }
+ }
+#endif
+
rrd_init(&rrd);
rrd_file = rrd_open(filename, &rrd, RRD_READONLY);
if (rrd_file == NULL)
rrd_init(&rrd);
rrd_file = rrd_open(filename, &rrd, RRD_READONLY);
if (rrd_file == NULL)
@@
-249,7
+258,7
@@
int rrd_fetch_fn(
}
for (i = 0; (unsigned long) i < rrd.stat_head->ds_cnt; i++) {
}
for (i = 0; (unsigned long) i < rrd.stat_head->ds_cnt; i++) {
- if ((((*ds_namv)[i]) = malloc(sizeof(char) * DS_NAM_SIZE)) == NULL) {
+ if ((((*ds_namv)[i]) =
(char*)
malloc(sizeof(char) * DS_NAM_SIZE)) == NULL) {
rrd_set_error("malloc fetch ds_namv entry");
goto err_free_ds_namv;
}
rrd_set_error("malloc fetch ds_namv entry");
goto err_free_ds_namv;
}
@@
-349,7
+358,7
@@
int rrd_fetch_fn(
** database is the one with time stamp (t+s) which means t to t+s.
*/
*ds_cnt = rrd.stat_head->ds_cnt;
** database is the one with time stamp (t+s) which means t to t+s.
*/
*ds_cnt = rrd.stat_head->ds_cnt;
- if (((*data) = malloc(*ds_cnt * rows * sizeof(rrd_value_t))) == NULL) {
+ if (((*data) =
(rrd_value_t*)
malloc(*ds_cnt * rows * sizeof(rrd_value_t))) == NULL) {
rrd_set_error("malloc fetch data area");
goto err_free_all_ds_namv;
}
rrd_set_error("malloc fetch data area");
goto err_free_all_ds_namv;
}