Skip to content

Commit

Permalink
lib-dns: Set error_r in dns_client_connect() on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
mrannanj committed Aug 29, 2018
1 parent 0a53503 commit eab25e2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib-dns/dns-lookup.c
Expand Up @@ -321,15 +321,19 @@ void dns_client_deinit(struct dns_client **_client)
i_free(client);
}

int dns_client_connect(struct dns_client *client, const char **error_r ATTR_UNUSED)
int dns_client_connect(struct dns_client *client, const char **error_r)
{
if (client->connected)
return 0;
client->conn.event_parent = client->event;
connection_init_client_unix(client->clist, &client->conn, client->path);
if (client->ioloop != NULL)
connection_switch_ioloop_to(&client->conn, client->ioloop);
return connection_client_connect(&client->conn);
int ret = connection_client_connect(&client->conn);
if (ret < 0)
*error_r = t_strdup_printf("Failed to connect to %s: %m",
client->path);
return ret;
}

static int
Expand Down

0 comments on commit eab25e2

Please sign in to comment.