]> git.ipfire.org Git - people/ms/dma.git/commitdiff
Make add_host() really return an error code.
authorPeter Pentchev <roam@ringlet.net>
Fri, 17 Dec 2010 11:31:41 +0000 (13:31 +0200)
committerPeter Pentchev <roam@ringlet.net>
Fri, 17 Dec 2010 11:31:41 +0000 (13:31 +0200)
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 :)

dns.c

diff --git a/dns.c b/dns.c
index ef78e64d2db4e03ecab646cb294ae162bf1bd9e0..ce80745730e91d2bc728ed068bfdc30ffa87dcc7 100644 (file)
--- 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)