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-question.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-question.h')
-rw-r--r-- | src/resolve/resolved-dns-question.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-question.h b/src/resolve/resolved-dns-question.h index ea41478975..a9a1863b1e 100644 --- a/src/resolve/resolved-dns-question.h +++ b/src/resolve/resolved-dns-question.h @@ -56,6 +56,10 @@ static inline unsigned dns_question_size(DnsQuestion *q) { return q ? q->n_keys : 0; } +static inline bool dns_question_isempty(DnsQuestion *q) { + return dns_question_size(q) <= 0; +} + DEFINE_TRIVIAL_CLEANUP_FUNC(DnsQuestion*, dns_question_unref); #define _DNS_QUESTION_FOREACH(u, key, q) \ |