int argc,
char **argv)
{
+ struct option long_options[] = {
+ {"start", required_argument, 0, 'b'},
+ {"step", required_argument, 0, 's'},
+ {0, 0, 0, 0}
+ };
+ int option_index = 0;
+ int opt;
time_t last_up = time(NULL) - 10;
unsigned long pdp_step = 300;
struct rrd_time_value last_up_tv;
opterr = 0; /* initialize getopt */
while (1) {
- static struct option long_options[] = {
- {"start", required_argument, 0, 'b'},
- {"step", required_argument, 0, 's'},
- {0, 0, 0, 0}
- };
- int option_index = 0;
- int opt;
-
opt = getopt_long(argc, argv, "b:s:", long_options, &option_index);
if (opt == EOF)
if ((rrd_file = fopen(file_name, "wb")) == NULL) {
rrd_set_error("creating '%s': %s", file_name, rrd_strerror(errno));
- free(rrd->stat_head);
- rrd->stat_head = NULL;
- free(rrd->ds_def);
- rrd->ds_def = NULL;
- free(rrd->rra_def);
- rrd->rra_def = NULL;
+ rrd_free(rrd);
return (-1);
}