summaryrefslogtreecommitdiff
path: root/examples/ldns-keyfetcher.c
diff options
context:
space:
mode:
authorWillem Toorop <willem@NLnetLabs.nl>2012-09-27 10:50:22 +0200
committerWillem Toorop <willem@NLnetLabs.nl>2012-09-27 10:50:22 +0200
commit302fdcd661deb6d49b6437940832cbe8b21e4744 (patch)
treeaab318a4c1a66c96fb2b7ad87855022cc849e865 /examples/ldns-keyfetcher.c
parent61114702544197ff16caffcdf7f3e443e81d1e0f (diff)
downloadldns-302fdcd661deb6d49b6437940832cbe8b21e4744.tar.gz
bit more consisten error handling flow control
Diffstat (limited to 'examples/ldns-keyfetcher.c')
-rw-r--r--examples/ldns-keyfetcher.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/ldns-keyfetcher.c b/examples/ldns-keyfetcher.c
index ee06aea9..fa78b432 100644
--- a/examples/ldns-keyfetcher.c
+++ b/examples/ldns-keyfetcher.c
@@ -649,7 +649,7 @@ main(int argc, char *argv[])
fprintf(stderr, "Warning: Unable to create stub resolver from /etc/resolv.conf:\n");
fprintf(stderr, "%s\n", ldns_get_errorstr_by_id(status));
fprintf(stderr, "defaulting to nameserver at 127.0.0.1 for separate nameserver name lookups\n");
- for (;;) {
+ do {
res = ldns_resolver_new();
if (res) {
ns = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_A,
@@ -664,9 +664,11 @@ main(int argc, char *argv[])
}
ldns_resolver_free(res);
}
- fprintf(stderr, "Unable to create stub resolver: %s\n", ldns_get_errorstr_by_id(status));
+ fprintf(stderr, "Unable to create stub resolver: %s\n",
+ ldns_get_errorstr_by_id(status));
exit(EXIT_FAILURE);
- }
+
+ } while (false);
ldns_rdf_deep_free(ns);
}