diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2011-04-11 18:03:02 +0200 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2011-04-23 02:04:58 +0200 |
commit | 4bac793e3e7238543883c4026600515244469af7 (patch) | |
tree | 78b666beeec775243d69869231fd4a8d3063eaca /sample/dns-example.c | |
parent | 48c44a6ddaf995ddbb8cc93d07beedf113f5cbac (diff) | |
download | libevent-4bac793e3e7238543883c4026600515244469af7.tar.gz |
Be nice and "handle" error return values in sample code
Caught by clang's static analyzer
Diffstat (limited to 'sample/dns-example.c')
-rw-r--r-- | sample/dns-example.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sample/dns-example.c b/sample/dns-example.c index 439a486a..2845cb99 100644 --- a/sample/dns-example.c +++ b/sample/dns-example.c @@ -120,6 +120,8 @@ evdns_server_callback(struct evdns_server_request *req, void *data) printf(" -- replying for %s (PTR)\n", req->questions[i]->name); r = evdns_server_request_add_ptr_reply(req, NULL, req->questions[i]->name, "foo.bar.example.com", 10); + if (r<0) + printf("ugh, no luck"); } else { printf(" -- skipping %s [%d %d]\n", req->questions[i]->name, req->questions[i]->type, req->questions[i]->dns_question_class); |