diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-06-24 14:45:33 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2020-06-24 14:51:36 +0200 |
commit | f6f1f18bd8ccb42a5cfb6531cd627e07cbb212f0 (patch) | |
tree | 3d2ef3d04e15e2f7961b45f41bcf236aa611d8d0 /sources | |
parent | 1a406b2d1935cdb66a3aa40b3f3554fabd67716e (diff) |
#971 syslog on error from the initialization path
Diffstat (limited to 'sources')
-rw-r--r-- | sources/main.c | 12 |
1 files changed, 9 insertions, 3 deletions
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); |