]> git.itanic.dy.fi Git - rrdd/blob - main.c
Suppress warning messages
[rrdd] / main.c
1 #include <sys/types.h>
2 #include <unistd.h>
3
4 #include "process.h"
5 #include "draw_graphs.h"
6 #include "parser.h"
7 #include "scheduler.h"
8
9 #include "testdata.h"
10
11
12 int main(int argc, char *argv[])
13 {
14         struct rrd_database *db;
15         int sleeptime;
16
17         while (1) {
18                 printf("%d: loop start\n", getpid());
19                 /*
20                  * Update all databases parallel in one shot
21                  */
22                 while ((db = check_update_need((struct rrd_database **)
23                                                &all_rrds)))
24                         update_data(db);
25
26                 /*
27                  * Let the updates finish
28                  */
29                 if (harvest_zombies(0))
30                         continue;
31
32                 sleeptime = get_next_update((struct rrd_database **)&all_rrds);
33                 printf("Time to sleep %d seconds\n", sleeptime);
34                 sleep(sleeptime);
35
36         }
37         return 0;
38 }