mirror of https://github.com/getdnsapi/getdns.git
Allow errors while setting up listeners
This commit is contained in:
parent
bae426a0e2
commit
689fc02fd2
|
@ -804,6 +804,8 @@ getdns_return_t getdns_context_set_listen_addresses(getdns_context *context,
|
|||
new_set->count = new_set_count * n_transports;
|
||||
(void) memset(new_set->items, 0,
|
||||
sizeof(listener) * new_set_count * n_transports);
|
||||
for (i = 0; i < new_set->count; i++)
|
||||
new_set->items[i].fd = -1;
|
||||
|
||||
(void) memset(&hints, 0, sizeof(struct addrinfo));
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
|
@ -906,7 +908,7 @@ getdns_return_t getdns_context_set_listen_addresses(getdns_context *context,
|
|||
/* So the event can be rescheduled */
|
||||
}
|
||||
}
|
||||
if ((r = add_listeners(new_set))) {
|
||||
if (r || (r = add_listeners(new_set))) {
|
||||
for (i = 0; i < new_set->count; i++)
|
||||
new_set->items[i].action = to_remove;
|
||||
|
||||
|
|
Loading…
Reference in New Issue