]> git.itanic.dy.fi Git - rrdd/blob - main.c
Remove commented code and update
[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(&all_rrds)))
23                         update_data(db);
24
25                 /*
26                  * Let the updates finish
27                  */
28                 if (harvest_zombies(0))
29                         continue;
30
31                 sleeptime = get_next_update(&all_rrds);
32                 printf("Time to sleep %d seconds\n", sleeptime);
33                 sleep(sleeptime);
34
35         }
36         return 0;
37 }