summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2006-03-01 01:37:03 +0000
committerStef Walter <stef@memberwebs.com>2006-03-01 01:37:03 +0000
commit6972f27080656ad3d2601fcb921c9a2389ac08a5 (patch)
tree2a42d64632779462a3f3b6a01c7c2640399e5704 /tools
parentb97cb618663bacba6ef4281a15a361599acff931 (diff)
Don't try and create files that don't have a create section.
Diffstat (limited to 'tools')
-rw-r--r--tools/rrdbot-create.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/rrdbot-create.c b/tools/rrdbot-create.c
index c7a7350..14e7b43 100644
--- a/tools/rrdbot-create.c
+++ b/tools/rrdbot-create.c
@@ -75,6 +75,7 @@ typedef struct _create_ctx
{
const char* workdir;
const char* confname;
+ int create;
int skip;
create_arg* args;
}
@@ -254,6 +255,10 @@ check_create_file(create_ctx* ctx)
ASSERT(ctx->confname);
+ /* No create section, no create */
+ if(!ctx->create)
+ return;
+
snprintf(rrd, sizeof(rrd), "%s/%s.rrd", ctx->workdir, ctx->confname);
rrd[sizeof(rrd) - 1] = 0;
@@ -362,6 +367,7 @@ cfg_value(const char* filename, const char* header, const char* name,
}
ctx->skip = 0;
+ ctx->create = 0;
return 0;
}
@@ -371,6 +377,9 @@ cfg_value(const char* filename, const char* header, const char* name,
if(strcmp(header, CONFIG_CREATE) != 0)
return 0;
+ /* Have a [create] section */
+ ctx->create = 1;
+
/* The rra option */
if(strcmp(name, CONFIG_RRA) == 0)
add_rras(ctx, value);