]> git.itanic.dy.fi Git - rrdd/commitdiff
config: Allow databases without filenames
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sat, 21 Nov 2020 09:38:18 +0000 (11:38 +0200)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sat, 21 Nov 2020 09:38:18 +0000 (11:38 +0200)
These are useful when we want to specify a job that does not have an
rrd database associated with it at all.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
config.c

index fec0454bff98e6016f50ecef5cedadd311381716..83242033d6958c329d51c219c92c29c683839a2d 100644 (file)
--- a/config.c
+++ b/config.c
@@ -243,10 +243,9 @@ static int parse_database(config_setting_t *rrd, struct rrd_database *db)
        pr_info("parsing database %s\n", name);
        db->name = strdup(name);
 
        pr_info("parsing database %s\n", name);
        db->name = strdup(name);
 
-       if (!config_setting_lookup_string(rrd, "filename", &filename)) {
+       if (!config_setting_lookup_string(rrd, "filename", &filename))
                pr_err("Database %s does not contain filename\n", db->name);
                pr_err("Database %s does not contain filename\n", db->name);
-               return -1;
-       }
+
        db->filename = strdup(filename);
 
        if (!config_setting_lookup_int(rrd, "interval", &db->interval)) {
        db->filename = strdup(filename);
 
        if (!config_setting_lookup_int(rrd, "interval", &db->interval)) {