]> git.itanic.dy.fi Git - rrdd/commitdiff
Rename the built in database to default_rrds
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Wed, 20 Jun 2012 19:50:34 +0000 (22:50 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Wed, 20 Jun 2012 19:51:53 +0000 (22:51 +0300)
In future this is not going to be the database in use, but the default
one that contains the data that can be used to dump the default
database list. Thus the change in the name.

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

index dd458f36aac8b4f448d36f4a9fe36871becadbf8..2877c882f6d91a6745aea0803979103f0fca62fd 100644 (file)
@@ -451,7 +451,7 @@ static struct rrd_database network_rrd = {
        .images         = network_images,
 };
 
-static struct rrd_database *all_rrds[] = {
+static struct rrd_database *default_rrds[] = {
        &cpumem_rrd,
        &systemp_rrd,
        &network_rrd,
diff --git a/main.c b/main.c
index 17cfc8acc993da3090c6699d26d36a59265df214..c7f6f044b423b3ec5642cf58af70062c2bc3e51a 100644 (file)
--- a/main.c
+++ b/main.c
@@ -45,7 +45,7 @@ int read_args(int argc, char *argv[], struct user_options *opts)
 int main(int argc, char *argv[])
 {
        struct user_options opts;
-       struct rrd_database *db;
+       struct rrd_database *db, **db_list = NULL;
        int sleeptime;
 
        bzero(&opts, sizeof(opts));
@@ -53,7 +53,8 @@ int main(int argc, char *argv[])
        if (read_args(argc, argv, &opts) < 0)
                return -1;
 
-       rrdtool_create_missing_databases(all_rrds);
+       if (rrdtool_create_missing_databases(db_list))
+               return 1;
 
        if (init_jobcontrol(opts.max_jobs))
                return -1;
@@ -63,11 +64,10 @@ int main(int argc, char *argv[])
                /*
                 * Update all databases parallel in one shot
                 */
-               while ((db = get_outdated_db((struct rrd_database **)
-                                              &all_rrds)))
+               while ((db = get_outdated_db(db_list)))
                        rrdtool_update_data(db);
 
-               sleeptime = get_next_update((struct rrd_database **)&all_rrds);
+               sleeptime = get_next_update(db_list);
 
                pr_info("Time to sleep %d seconds\n", sleeptime);
                poll_job_requests(sleeptime);