/*****************************************************************************
- * RRDtool 1.3rc7 Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.3.1 Copyright by Tobi Oetiker, 1997-2008
*****************************************************************************
* rrd_update.c RRD Update Function
*****************************************************************************
char **updvals,
long *tmpl_idx,
unsigned long tmpl_cnt,
- rrd_info_t **pcdp_summary,
+ rrd_info_t ** pcdp_summary,
int version,
unsigned long *skip_update,
int *schedule_smooth);
unsigned long *rra_current,
time_t current_time,
unsigned long *skip_update,
- rrd_info_t **pcdp_summary);
+ rrd_info_t ** pcdp_summary);
static int write_RRA_row(
rrd_file_t *rrd_file,
unsigned long rra_idx,
unsigned long *rra_current,
unsigned short CDP_scratch_idx,
- rrd_info_t **pcdp_summary,
+ rrd_info_t ** pcdp_summary,
time_t rra_time);
static int smooth_all_rras(
char **argv)
{
char *tmplt = NULL;
- rrd_info_t *result = NULL;
+ rrd_info_t *result = NULL;
rrd_infoval_t rc;
struct option long_options[] = {
{"template", required_argument, 0, 't'},
const char *tmplt,
int argc,
const char **argv,
- rrd_info_t *pcdp_summary)
+ rrd_info_t * pcdp_summary)
{
int arg_i = 2;
rra_step_cnt, updvals, tmpl_idx, tmpl_cnt,
&pcdp_summary, version, skip_update,
&schedule_smooth) == -1) {
+ if (rrd_test_error()) { /* Should have error string always here */
+ char *save_error;
+
+ /* Prepend file name to error message */
+ if ((save_error = strdup(rrd_get_error())) != NULL) {
+ rrd_set_error("%s: %s", filename, save_error);
+ free(save_error);
+ }
+ }
free(arg_copy);
break;
}
char **updvals,
long *tmpl_idx,
unsigned long tmpl_cnt,
- rrd_info_t **pcdp_summary,
+ rrd_info_t ** pcdp_summary,
int version,
unsigned long *skip_update,
int *schedule_smooth)
unsigned long *rra_current,
time_t current_time,
unsigned long *skip_update,
- rrd_info_t **pcdp_summary)
+ rrd_info_t ** pcdp_summary)
{
unsigned long rra_idx;
unsigned long rra_start;
unsigned long rra_idx,
unsigned long *rra_current,
unsigned short CDP_scratch_idx,
- rrd_info_t **pcdp_summary,
+ rrd_info_t ** pcdp_summary,
time_t rra_time)
{
unsigned long ds_idx, cdp_idx;
iv.u_val = rrd->cdp_prep[cdp_idx].scratch[CDP_scratch_idx].u_val;
/* append info to the return hash */
*pcdp_summary = rrd_info_push(*pcdp_summary,
- sprintf_alloc("[%d]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), RD_I_VAL, iv);
+ sprintf_alloc
+ ("[%d]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),
+ RD_I_VAL, iv);
}
if (rrd_write(rrd_file,
&(rrd->cdp_prep[cdp_idx].scratch[CDP_scratch_idx].