diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-06-20 21:28:53 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-06-21 13:20:48 +0200 |
commit | 501e8eb0549bb6c3f5d08b6f6c6ad7c6a34575ba (patch) | |
tree | 221e628bf3252fd2dfb85b429530fe28a82befe7 /src/resolve/resolved-dns-answer.h | |
parent | 17c8de633faad3ac97012e066c6c6b2f71b83a67 (diff) |
resolved: add dns_answer_is_empty() and dns_question_is_empty() helpers
And make use of them at a few places.
Diffstat (limited to 'src/resolve/resolved-dns-answer.h')
-rw-r--r-- | src/resolve/resolved-dns-answer.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-answer.h b/src/resolve/resolved-dns-answer.h index b2b86d1772..4a92bd1150 100644 --- a/src/resolve/resolved-dns-answer.h +++ b/src/resolve/resolved-dns-answer.h @@ -87,6 +87,10 @@ static inline unsigned dns_answer_size(DnsAnswer *a) { return a ? a->n_rrs : 0; } +static inline bool dns_answer_isempty(DnsAnswer *a) { + return dns_answer_size(a) <= 0; +} + void dns_answer_dump(DnsAnswer *answer, FILE *f); DEFINE_TRIVIAL_CLEANUP_FUNC(DnsAnswer*, dns_answer_unref); |