diff options
author | NIIBE Yutaka <[email protected]> | 2019-02-26 03:13:35 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-03-07 12:03:15 +0000 |
commit | 4ab0fef5dc856d1f2747efab584182aa880f631c (patch) | |
tree | 7709485fd1fe0c711299ab62e846436612278623 /dirmngr/dns-stuff.c | |
parent | libdns: Avoid using compound literals (6). (diff) | |
download | gnupg-4ab0fef5dc856d1f2747efab584182aa880f631c.tar.gz gnupg-4ab0fef5dc856d1f2747efab584182aa880f631c.zip |
libdns: Avoid using compound literals (7).
* dirmngr/dns.h (DNS_OPTS_INIT, dns_opts): Remove.
* dirmngr/dns-stuff.c (libdns_res_open): Use zero-ed, and initialized
automatic variable for opts.
* dirmngr/dns.c (send_query, resolve_query, resolve_addrinfo):
Likewise.
--
In fact, DNS_OPTS_INIT was only needed when args are none. With
partially specified initialization, C99 guarantees zero-ed other
members just like static object.
Signed-off-by: NIIBE Yutaka <[email protected]>
(cherry picked from commit d661acd483236d34720a4959fc816d05f89c2cb7)
Diffstat (limited to 'dirmngr/dns-stuff.c')
-rw-r--r-- | dirmngr/dns-stuff.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c index 330eb0136..a5087e573 100644 --- a/dirmngr/dns-stuff.c +++ b/dirmngr/dns-stuff.c @@ -691,6 +691,11 @@ libdns_res_open (struct dns_resolver **r_res) gpg_error_t err; struct dns_resolver *res; int derr; + struct dns_options opts = { 0 }; + + opts.socks_host = &libdns.socks_host; + opts.socks_user = tor_socks_user; + opts.socks_password = tor_socks_password; *r_res = NULL; @@ -716,10 +721,7 @@ libdns_res_open (struct dns_resolver **r_res) set_dns_timeout (0); res = dns_res_open (libdns.resolv_conf, libdns.hosts, libdns.hints, NULL, - dns_opts (.socks_host = &libdns.socks_host, - .socks_user = tor_socks_user, - .socks_password = tor_socks_password ), - &derr); + &opts, &derr); if (!res) return libdns_error_to_gpg_error (derr); |