}
}
/* need at least 2 arguments: filename, data. */
if (argc - optind < 2) {
rrd_set_error("Not enough arguments");
}
}
/* need at least 2 arguments: filename, data. */
if (argc - optind < 2) {
rrd_set_error("Not enough arguments");
}
rc = rrd_update_r(argv[optind], tmplt,
argc - optind - 1, (const char **) (argv + optind + 1));
}
rc = rrd_update_r(argv[optind], tmplt,
argc - optind - 1, (const char **) (argv + optind + 1));
goto err_free_updvals;
}
if ((*skip_update = (unsigned long *)malloc(sizeof(unsigned long)
* rrd->stat_head->rra_cnt)) == NULL) {
goto err_free_updvals;
}
if ((*skip_update = (unsigned long *)malloc(sizeof(unsigned long)
* rrd->stat_head->rra_cnt)) == NULL) {
goto err_free_skip_update;
}
if ((*rra_step_cnt = (unsigned long *)malloc(sizeof(unsigned long)
* (rrd->stat_head->rra_cnt))) == NULL) {
goto err_free_skip_update;
}
if ((*rra_step_cnt = (unsigned long *)malloc(sizeof(unsigned long)
* (rrd->stat_head->rra_cnt))) == NULL) {
{
char *dsname, *tmplt_copy;
unsigned int tmpl_len, i;
{
char *dsname, *tmplt_copy;
unsigned int tmpl_len, i;
*tmpl_cnt = 1; /* the first entry is the time */
/* we should work on a writeable copy here */
if ((tmplt_copy = strdup(tmplt)) == NULL) {
rrd_set_error("error copying tmplt '%s'", tmplt);
*tmpl_cnt = 1; /* the first entry is the time */
/* we should work on a writeable copy here */
if ((tmplt_copy = strdup(tmplt)) == NULL) {
rrd_set_error("error copying tmplt '%s'", tmplt);
tmplt_copy[i] = '\0';
if (*tmpl_cnt > rrd->stat_head->ds_cnt) {
rrd_set_error("tmplt contains more DS definitions than RRD");
tmplt_copy[i] = '\0';
if (*tmpl_cnt > rrd->stat_head->ds_cnt) {
rrd_set_error("tmplt contains more DS definitions than RRD");
}
if ((tmpl_idx[(*tmpl_cnt)++] = ds_match(rrd, dsname)+1) == 0) {
rrd_set_error("unknown DS name '%s'", dsname);
}
if ((tmpl_idx[(*tmpl_cnt)++] = ds_match(rrd, dsname)+1) == 0) {
rrd_set_error("unknown DS name '%s'", dsname);