From af9c5fc92f0a9c5b5becfdbcb9f6d3a4b80ad723 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sun, 6 Aug 2006 22:47:11 +0000 Subject: when in -n mode, print commands even when it exists. --- tools/rrdbot-create.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tools/rrdbot-create.c b/tools/rrdbot-create.c index 9760051..aa2ae0b 100644 --- a/tools/rrdbot-create.c +++ b/tools/rrdbot-create.c @@ -458,16 +458,19 @@ check_create_file(create_ctx* ctx) rrd[sizeof(rrd) - 1] = 0; } - /* Make sure it exists */ - if(access(rrd, F_OK) == 0) + if(!g_print) { - verb("rrd file already exists, skipping: %s", rrd); - return; - } - else if(errno != ENOENT) - { - warn("couldn't check rrd file: %s", rrd); - return; + /* Make sure it exists */ + if(access(rrd, F_OK) == 0) + { + verb("rrd file already exists, skipping: %s", rrd); + return; + } + else if(errno != ENOENT) + { + warn("couldn't check rrd file: %s", rrd); + return; + } } if(ctx->skip || create_file(ctx, rrd) < 0) -- cgit v1.2.3