diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-25 21:07:17 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-25 22:00:07 +0100 |
commit | dc477e7385e8ab29efb8fadb72ec994077a105c6 (patch) | |
tree | 04590e41525b1b60c969cd8c3cc5be9a90fe271e /src/resolve/resolved-dns-search-domain.c | |
parent | 801ad6a6a9cd8fbd58b9f9c27f20dbb3c87d47dd (diff) |
dns-domain: simplify dns_name_is_root() and dns_name_is_single_label()
Let's change the return value to bool. If we encounter an error while
parsing, return "false" instead of the actual parsing error, after all
the specified hostname does not qualify for what the function is
supposed to test.
Dealing with the additional error codes was always cumbersome, and
easily misused, like for example in the DHCP code.
Let's also rename the functions from dns_name_root() to
dns_name_is_root(), to indicate that this function checks something and
returns a bool. Similar for dns_name_is_signal_label().
Diffstat (limited to 'src/resolve/resolved-dns-search-domain.c')
-rw-r--r-- | src/resolve/resolved-dns-search-domain.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/resolve/resolved-dns-search-domain.c b/src/resolve/resolved-dns-search-domain.c index d8a0648aab..f9d966abb1 100644 --- a/src/resolve/resolved-dns-search-domain.c +++ b/src/resolve/resolved-dns-search-domain.c @@ -42,10 +42,7 @@ int dns_search_domain_new( if (r < 0) return r; - r = dns_name_root(normalized); - if (r < 0) - return r; - if (r > 0) + if (dns_name_is_root(normalized)) return -EINVAL; if (l) { |