diff options
author | NIIBE Yutaka <[email protected]> | 2019-02-26 03:13:35 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2019-02-26 03:13:35 +0000 |
commit | d661acd483236d34720a4959fc816d05f89c2cb7 (patch) | |
tree | 7e546118b6e1d8f0841149618854bfdbc78dd519 /dirmngr/dns-stuff.c | |
parent | libdns: Avoid using compound literals (6). (diff) | |
download | gnupg-d661acd483236d34720a4959fc816d05f89c2cb7.tar.gz gnupg-d661acd483236d34720a4959fc816d05f89c2cb7.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]>
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 a1aa3145e..e48aca730 100644 --- a/dirmngr/dns-stuff.c +++ b/dirmngr/dns-stuff.c @@ -701,6 +701,11 @@ libdns_res_open (ctrl_t ctrl, 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; @@ -726,10 +731,7 @@ libdns_res_open (ctrl_t ctrl, 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); |