summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f87217b)
raw | patch | inline | side by side (parent: f87217b)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 27 Apr 2014 15:16:19 +0000 (17:16 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 27 Apr 2014 15:16:19 +0000 (17:16 +0200) |
src/tools/sysdbd/main.c | patch | blob | history |
index 144128ccaadea8aeabf881ae9802e90dc69ec737..4af2de13715ff1f59189ef0e9e4cab90e408b253 100644 (file)
--- a/src/tools/sysdbd/main.c
+++ b/src/tools/sysdbd/main.c
main_loop(void)
{
sdb_fe_socket_t *sock = sdb_fe_sock_create();
-
pthread_t backend_thread;
+ int status = 0;
+
while (42) {
size_t i;
break;
}
- for (i = 0; i < listen_addresses_num; ++i)
- if (sdb_fe_sock_add_listener(sock, listen_addresses[i]))
+ for (i = 0; i < listen_addresses_num; ++i) {
+ if (sdb_fe_sock_add_listener(sock, listen_addresses[i])) {
+ status = 1;
break;
+ }
+ }
/* break on error */
- if (i >= listen_addresses_num) {
- sdb_log(SDB_LOG_INFO, "SysDB daemon "SDB_VERSION_STRING
- SDB_VERSION_EXTRA " (pid %i) initialized successfully",
- (int)getpid());
+ if (i < listen_addresses_num) {
+ status = 1;
+ break;
+ }
- sdb_connection_enable_logging();
+ sdb_log(SDB_LOG_INFO, "SysDB daemon "SDB_VERSION_STRING
+ SDB_VERSION_EXTRA " (pid %i) initialized successfully",
+ (int)getpid());
- sdb_fe_sock_listen_and_serve(sock, &frontend_main_loop);
- }
+ sdb_connection_enable_logging();
+ sdb_fe_sock_listen_and_serve(sock, &frontend_main_loop);
sdb_log(SDB_LOG_INFO, "Waiting for backend thread to terminate");
plugin_main_loop.do_loop = 0;
sdb_fe_sock_clear_listeners(sock);
if (do_reconfigure()) {
sdb_log(SDB_LOG_ERR, "Reconfiguration failed");
+ status = 1;
break;
}
}
sdb_fe_sock_destroy(sock);
- return 0;
+ return status;
} /* main_loop */
int