From: Peter Pentchev Date: Fri, 17 Dec 2010 11:31:41 +0000 (+0200) Subject: Make add_host() really return an error code. X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Fdma.git;a=commitdiff_plain;h=06dd5b8936f8aaaf02ec9a449e86073f50ffa607 Make add_host() really return an error code. Now that add_host() *may* return an error, it is kind of confusing (and actually leads to errors) that it also returns the number of hosts added to the value/result "hosts" array. Since the caller really checks add_host()'s return value now, a successful lookup that returns one host added will be treated as an error :) --- diff --git a/dns.c b/dns.c index ef78e64..ce80745 100644 --- a/dns.c +++ b/dns.c @@ -105,7 +105,7 @@ add_host(int pref, const char *host, int port, struct mx_hostentry **he, size_t } freeaddrinfo(res0); - return (*ps - onhosts); + return (0); out: if (res0 != NULL)