summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4a0488a)
raw | patch | inline | side by side (parent: 4a0488a)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 22 Oct 2013 07:08:37 +0000 (09:08 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 22 Oct 2013 07:08:37 +0000 (09:08 +0200) |
src/daemon/sysdbd.c | patch | blob | history |
diff --git a/src/daemon/sysdbd.c b/src/daemon/sysdbd.c
index 6e75c039bb21f1f5761df3f1e363b13b8f7136fe..072807dc84611ec26df49beb157cbe72a67ccf31 100644 (file)
--- a/src/daemon/sysdbd.c
+++ b/src/daemon/sysdbd.c
sdb_fe_socket_t *sock = sdb_fe_sock_create();
for (i = 0; i < listen_addresses_num; ++i)
- sdb_fe_sock_add_listener(sock, listen_addresses[i]);
- sdb_fe_sock_listen_and_serve(sock, &frontend_main_loop);
+ if (sdb_fe_sock_add_listener(sock, listen_addresses[i]))
+ break;
+
+ /* break on error */
+ if (i >= listen_addresses_num)
+ sdb_fe_sock_listen_and_serve(sock, &frontend_main_loop);
+ plugin_main_loop.do_loop = 0;
pthread_join(backend_thread, NULL);
+ sdb_fe_sock_destroy(sock);
}
sdb_log(SDB_LOG_INFO, "Shutting down SysDB daemon "SDB_VERSION_STRING