summaryrefslogtreecommitdiff
path: root/src/libsystemd/test-resolv.c
diff options
context:
space:
mode:
authorDaniel Buch <boogiewasthere@gmail.com>2014-01-14 11:46:49 +0100
committerTom Gundersen <teg@jklm.no>2014-01-14 13:32:13 +0100
commit12f404c4d1dc31a54013646473249b4644fc23e7 (patch)
treec9c2c15c8273b2e99fd13c577afe618eddb6f559 /src/libsystemd/test-resolv.c
parent2a4be8ad9896ebd02d0d92be1a116aabd2bf402b (diff)
sd-resolv: rename old asyncns variables
Diffstat (limited to 'src/libsystemd/test-resolv.c')
-rw-r--r--src/libsystemd/test-resolv.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/libsystemd/test-resolv.c b/src/libsystemd/test-resolv.c
index aa26931db5..5baef9693a 100644
--- a/src/libsystemd/test-resolv.c
+++ b/src/libsystemd/test-resolv.c
@@ -37,7 +37,7 @@
int main(int argc, char *argv[]) {
int r = 1, ret;
- _cleanup_resolv_free_ sd_resolv_t *asyncns = NULL;
+ _cleanup_resolv_free_ sd_resolv_t *resolv = NULL;
_cleanup_resolv_addrinfo_free_ struct addrinfo *ai = NULL;
_cleanup_resolv_answer_free_ unsigned char *srv = NULL;
sd_resolv_query_t *q1, *q2, *q3;
@@ -47,15 +47,15 @@ int main(int argc, char *argv[]) {
signal(SIGCHLD, SIG_IGN);
- asyncns = sd_resolv_new(2);
- if (!asyncns)
+ resolv = sd_resolv_new(2);
+ if (!resolv)
log_oom();
/* Make a name -> address query */
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
- q1 = sd_resolv_getaddrinfo(asyncns, argc >= 2 ? argv[1] : "www.heise.de", NULL, &hints);
+ q1 = sd_resolv_getaddrinfo(resolv, argc >= 2 ? argv[1] : "www.heise.de", NULL, &hints);
if (!q1)
fprintf(stderr, "sd_resolv_getaddrinfo(): %s\n", strerror(errno));
@@ -64,25 +64,25 @@ int main(int argc, char *argv[]) {
sa.sin_addr.s_addr = inet_addr(argc >= 3 ? argv[2] : "193.99.144.71");
sa.sin_port = htons(80);
- q2 = sd_resolv_getnameinfo(asyncns, (struct sockaddr*) &sa, sizeof(sa), 0, 1, 1);
+ q2 = sd_resolv_getnameinfo(resolv, (struct sockaddr*) &sa, sizeof(sa), 0, 1, 1);
if (!q2)
fprintf(stderr, "sd_resolv_getnameinfo(): %s\n", strerror(errno));
/* Make a res_query() call */
- q3 = sd_resolv_res_query(asyncns, "_xmpp-client._tcp.gmail.com", C_IN, T_SRV);
+ q3 = sd_resolv_res_query(resolv, "_xmpp-client._tcp.gmail.com", C_IN, T_SRV);
if (!q3)
fprintf(stderr, "sd_resolv_res_query(): %s\n", strerror(errno));
/* Wait until the three queries are completed */
- while (!sd_resolv_isdone(asyncns, q1) ||
- !sd_resolv_isdone(asyncns, q2) ||
- !sd_resolv_isdone(asyncns, q3)) {
- if (sd_resolv_wait(asyncns, 1) < 0)
+ while (!sd_resolv_isdone(resolv, q1) ||
+ !sd_resolv_isdone(resolv, q2) ||
+ !sd_resolv_isdone(resolv, q3)) {
+ if (sd_resolv_wait(resolv, 1) < 0)
fprintf(stderr, "sd_resolv_wait(): %s\n", strerror(errno));
}
/* Interpret the result of the name -> addr query */
- ret = sd_resolv_getaddrinfo_done(asyncns, q1, &ai);
+ ret = sd_resolv_getaddrinfo_done(resolv, q1, &ai);
if (ret)
fprintf(stderr, "error: %s %i\n", gai_strerror(ret), ret);
else {
@@ -102,14 +102,14 @@ int main(int argc, char *argv[]) {
}
/* Interpret the result of the addr -> name query */
- ret = sd_resolv_getnameinfo_done(asyncns, q2, host, sizeof(host), serv, sizeof(serv));
+ ret = sd_resolv_getnameinfo_done(resolv, q2, host, sizeof(host), serv, sizeof(serv));
if (ret)
fprintf(stderr, "error: %s %i\n", gai_strerror(ret), ret);
else
printf("%s -- %s\n", host, serv);
/* Interpret the result of the SRV lookup */
- ret = sd_resolv_res_done(asyncns, q3, &srv);
+ ret = sd_resolv_res_done(resolv, q3, &srv);
if (ret < 0) {
fprintf(stderr, "error: %s %i\n", strerror(errno), ret);
} else if (ret == 0) {