]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dns: Remove useless code
authorAki Tuomi <aki.tuomi@dovecot.fi>
Fri, 24 Aug 2018 08:42:56 +0000 (11:42 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 13 Nov 2018 13:09:44 +0000 (15:09 +0200)
Found by scan-build

src/lib-dns/dns-lookup.c

index a4c6108eff470c654b70053fe2991bd7a4cba68a..70edfb16abb5798ad73eebac404c984c3c61ade0 100644 (file)
@@ -354,10 +354,6 @@ dns_client_send_request(struct dns_client *client, const char *cmd,
        if (!client->connected) {
                if (dns_client_connect(client, error_r) < 0)
                        return -1;
-               ret = -1;
-       } else {
-               /* already connected. if write() fails, retry connecting */
-               ret = 0;
        }
 
        if ((ret = o_stream_send(client->conn.output, cmd, strlen(cmd))) < 0) {
@@ -367,7 +363,7 @@ dns_client_send_request(struct dns_client *client, const char *cmd,
                dns_client_disconnect(client, "Cannot send data");
        }
 
-       return 1;
+       return ret;
 }
 
 static int