diff options
author | snermolaev <snermolaev@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
commit | 7353a3fdea9c67c256980c00a2b3b67f09b23a27 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/libs/c-ares/ahost.c | |
parent | 2015790ac9fcc04caab83fccc23ab2460310a797 (diff) | |
download | ydb-7353a3fdea9c67c256980c00a2b3b67f09b23a27.tar.gz |
Restoring authorship annotation for <snermolaev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/c-ares/ahost.c')
-rw-r--r-- | contrib/libs/c-ares/ahost.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/contrib/libs/c-ares/ahost.c b/contrib/libs/c-ares/ahost.c index 6bbf0a38c8d..89a7c14fcbb 100644 --- a/contrib/libs/c-ares/ahost.c +++ b/contrib/libs/c-ares/ahost.c @@ -52,8 +52,8 @@ static void usage(void); int main(int argc, char **argv) { - struct ares_options options; - int optmask = 0; + struct ares_options options; + int optmask = 0; ares_channel channel; int status, nfds, c, addr_family = AF_INET; fd_set read_fds, write_fds; @@ -67,8 +67,8 @@ int main(int argc, char **argv) WSAStartup(wVersionRequested, &wsaData); #endif - memset(&options, 0, sizeof(options)); - + memset(&options, 0, sizeof(options)); + status = ares_library_init(ARES_LIB_INIT_ALL); if (status != ARES_SUCCESS) { @@ -76,7 +76,7 @@ int main(int argc, char **argv) return 1; } - while ((c = ares_getopt(argc,argv,"dt:hs:")) != -1) + while ((c = ares_getopt(argc,argv,"dt:hs:")) != -1) { switch (c) { @@ -85,20 +85,20 @@ int main(int argc, char **argv) dbug_init(); #endif break; - case 's': - optmask |= ARES_OPT_DOMAINS; - options.ndomains++; - options.domains = (char **)realloc(options.domains, - options.ndomains * sizeof(char *)); - options.domains[options.ndomains - 1] = strdup(optarg); - break; + case 's': + optmask |= ARES_OPT_DOMAINS; + options.ndomains++; + options.domains = (char **)realloc(options.domains, + options.ndomains * sizeof(char *)); + options.domains[options.ndomains - 1] = strdup(optarg); + break; case 't': if (!strcasecmp(optarg,"a")) addr_family = AF_INET; else if (!strcasecmp(optarg,"aaaa")) addr_family = AF_INET6; - else if (!strcasecmp(optarg,"u")) - addr_family = AF_UNSPEC; + else if (!strcasecmp(optarg,"u")) + addr_family = AF_UNSPEC; else usage(); break; @@ -114,7 +114,7 @@ int main(int argc, char **argv) if (argc < 1) usage(); - status = ares_init_options(&channel, &options, optmask); + status = ares_init_options(&channel, &options, optmask); if (status != ARES_SUCCESS) { fprintf(stderr, "ares_init: %s\n", ares_strerror(status)); @@ -143,16 +143,16 @@ int main(int argc, char **argv) /* Wait for all queries to complete. */ for (;;) { - int res; + int res; FD_ZERO(&read_fds); FD_ZERO(&write_fds); nfds = ares_fds(channel, &read_fds, &write_fds); if (nfds == 0) break; tvp = ares_timeout(channel, NULL, &tv); - res = select(nfds, &read_fds, &write_fds, NULL, tvp); - if (-1 == res) - break; + res = select(nfds, &read_fds, &write_fds, NULL, tvp); + if (-1 == res) + break; ares_process(channel, &read_fds, &write_fds); } |