From f6f1f18bd8ccb42a5cfb6531cd627e07cbb212f0 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Wed, 24 Jun 2020 14:45:33 +0200 Subject: #971 syslog on error from the initialization path --- sources/main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sources') diff --git a/sources/main.c b/sources/main.c index fe9306e..d0add72 100644 --- a/sources/main.c +++ b/sources/main.c @@ -42,21 +42,27 @@ int main(int argc, char *argv[]) } socket_rest = og_socket_server_init("8888"); - if (socket_rest < 0) + if (socket_rest < 0) { + syslog(LOG_ERR, "Cannot open REST API server socket\n"); exit(EXIT_FAILURE); + } ev_io_init(&ev_io_server_rest, og_server_accept_cb, socket_rest, EV_READ); ev_io_start(og_loop, &ev_io_server_rest); socket_agent_rest = og_socket_server_init("8889"); - if (socket_agent_rest < 0) + if (socket_agent_rest < 0) { + syslog(LOG_ERR, "Cannot open ogClient server socket\n"); exit(EXIT_FAILURE); + } ev_io_init(&ev_io_agent_rest, og_server_accept_cb, socket_agent_rest, EV_READ); ev_io_start(og_loop, &ev_io_agent_rest); - if (og_dbi_schedule_get() < 0) + if (og_dbi_schedule_get() < 0) { + syslog(LOG_ERR, "Cannot connect to database\n"); exit(EXIT_FAILURE); + } og_schedule_next(og_loop); -- cgit v1.2.3-18-g5258