int eat_tag(char **, char *);
int read_tag(char **, char *, char *, void *);
int xml2rrd(char*, rrd_t*, char);
int eat_tag(char **, char *);
int read_tag(char **, char *, char *, void *);
int xml2rrd(char*, rrd_t*, char);
void parse_patch1028_RRA_params(char **buf, rrd_t *rrd, int rra_index);
void parse_patch1028_CDP_params(char **buf, rrd_t *rrd, int rra_index, int ds_index);
void parse_FAILURES_history(char **buf, rrd_t *rrd, int rra_index, int ds_index);
void parse_patch1028_RRA_params(char **buf, rrd_t *rrd, int rra_index);
void parse_patch1028_CDP_params(char **buf, rrd_t *rrd, int rra_index, int ds_index);
void parse_FAILURES_history(char **buf, rrd_t *rrd, int rra_index, int ds_index);
- int fd = open(file_name,O_RDWR|O_CREAT|O_EXCL,0666);
+ fdflags = O_WRONLY|O_CREAT;
+ if (force_overwrite == 0) {
+ fdflags |= O_EXCL;
+ }
+ fd = open(file_name,fdflags,0666);
if (fd == -1 || (rrd_file = fdopen(fd,"wb")) == NULL) {
rrd_set_error("creating '%s': %s",file_name,rrd_strerror(errno));
if (fd != -1)
if (fd == -1 || (rrd_file = fdopen(fd,"wb")) == NULL) {
rrd_set_error("creating '%s': %s",file_name,rrd_strerror(errno));
if (fd != -1)
static struct option long_options[] =
{
{"range-check", required_argument, 0, 'r'},
static struct option long_options[] =
{
{"range-check", required_argument, 0, 'r'},
- opt = getopt_long(argc, argv, "r", long_options, &option_index);
+ opt = getopt_long(argc, argv, "r:f", long_options, &option_index);