diff options
| author | arf20 <aruizfernandez05@gmail.com> | 2025-10-27 16:54:00 +0100 |
|---|---|---|
| committer | arf20 <aruizfernandez05@gmail.com> | 2025-10-27 16:54:00 +0100 |
| commit | 52dc621b426fcb55ef3887e67de08a612b15480d (patch) | |
| tree | 2f4fcef15f5ce15f1bb482d2bc6148a15094ba2b /main.c | |
| parent | 8e937f139b118317fdaf7c2dbbb0669b508eb5ed (diff) | |
| download | arfnet2-status-52dc621b426fcb55ef3887e67de08a612b15480d.tar.gz arfnet2-status-52dc621b426fcb55ef3887e67de08a612b15480d.zip | |
implemented commiting events to disk
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -16,9 +16,15 @@ #include "monitor.h" -#define PORT 8888 #define RES_BUFF 65535 + +#define PORT 8888 + +#define CFG_FILE "monitor.cfg" +#define TMPL_FILE "index.htm.tmpl" +#define LOG_FILE "events.log" + static char *index_format_template = NULL; @@ -71,7 +77,7 @@ enum MHD_Result answer_to_connection( int main() { /* read index template file */ - FILE *tf = fopen("index.htm.tmpl", "r"); + FILE *tf = fopen(TMPL_FILE, "r"); if (!tf) { fprintf(stderr, "error opening index template file: %s\n", strerror(errno)); @@ -97,11 +103,11 @@ int main() { return 1; } - monitor_init("monitor.cfg", "events.log"); + monitor_init(CFG_FILE, LOG_FILE); while (1) { monitor_check(); - monitor_update_events(); + monitor_update_events(LOG_FILE); sleep(5); } } |
