projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure we use correct sizes for vsnprintf (sizeof) and strncpy (sizeof-1). --...
[rrdtool.git]
/
src
/
rrd_update.c
diff --git
a/src/rrd_update.c
b/src/rrd_update.c
index
108dcbb
..
fa50929
100644
(file)
--- a/
src/rrd_update.c
+++ b/
src/rrd_update.c
@@
-449,7
+449,7
@@
int rrd_update(
{
rc = rrdc_update (argv[optind], /* file */
argc - optind - 1, /* values_num */
{
rc = rrdc_update (argv[optind], /* file */
argc - optind - 1, /* values_num */
- (
void
*) (argv + optind + 1)); /* values */
+ (
const char *const
*) (argv + optind + 1)); /* values */
if (rc > 0)
rrd_set_error("Failed sending the values to rrdcached: %s",
rrd_strerror (rc));
if (rc > 0)
rrd_set_error("Failed sending the values to rrdcached: %s",
rrd_strerror (rc));
@@
-519,6
+519,7
@@
int _rrd_update(
goto err_out;
}
goto err_out;
}
+ rrd_init(&rrd);
if ((rrd_file = rrd_open(filename, &rrd, RRD_READWRITE)) == NULL) {
goto err_free;
}
if ((rrd_file = rrd_open(filename, &rrd, RRD_READWRITE)) == NULL) {
goto err_free;
}
@@
-1927,6
+1928,8
@@
static int write_to_rras(
(rrd_file, rrd, rra_idx, scratch_idx,
pcdp_summary, rra_time) == -1)
return -1;
(rrd_file, rrd, rra_idx, scratch_idx,
pcdp_summary, rra_time) == -1)
return -1;
+
+ rrd_notify_row(rrd_file, rra_idx, rra_pos_new, rra_time);
}
rra_start += rra_def->row_cnt * ds_cnt * sizeof(rrd_value_t);
}
rra_start += rra_def->row_cnt * ds_cnt * sizeof(rrd_value_t);
@@
-1964,7
+1967,7
@@
static int write_RRA_row(
/* append info to the return hash */
*pcdp_summary = rrd_info_push(*pcdp_summary,
sprintf_alloc
/* append info to the return hash */
*pcdp_summary = rrd_info_push(*pcdp_summary,
sprintf_alloc
- ("[%
d
]RRA[%s][%lu]DS[%s]", rra_time,
+ ("[%
lli
]RRA[%s][%lu]DS[%s]", rra_time,
rrd->rra_def[rra_idx].cf_nam,
rrd->rra_def[rra_idx].pdp_cnt,
rrd->ds_def[ds_idx].ds_nam),
rrd->rra_def[rra_idx].cf_nam,
rrd->rra_def[rra_idx].pdp_cnt,
rrd->ds_def[ds_idx].ds_nam),