diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-12-15 10:54:17 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-12-15 11:47:05 +0100 |
commit | 9d84fdec287532c0d58914c64988b3027902c4e7 (patch) | |
tree | 74cf6376edacf32e48415756c102b8e14d60a94c /src/resolve/resolved-conf.c | |
parent | af45251e4ce2ff48eb86769cccf48ffd51f49ce0 (diff) | |
download | systemd-9d84fdec287532c0d58914c64988b3027902c4e7.tar.gz |
resolved: return immediately if we already know what to return
Diffstat (limited to 'src/resolve/resolved-conf.c')
-rw-r--r-- | src/resolve/resolved-conf.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/resolve/resolved-conf.c b/src/resolve/resolved-conf.c index a4e44f29be..930313b844 100644 --- a/src/resolve/resolved-conf.c +++ b/src/resolve/resolved-conf.c @@ -66,17 +66,13 @@ int manager_parse_dns_server_string_and_warn(Manager *m, DnsServerType type, con _cleanup_free_ char *word = NULL; r = extract_first_word(&string, &word, NULL, 0); - if (r < 0) + if (r <= 0) return r; - if (r == 0) - break; r = manager_add_dns_server_by_string(m, type, word); if (r < 0) log_warning_errno(r, "Failed to add DNS server address '%s', ignoring: %m", word); } - - return 0; } static int manager_add_search_domain_by_string(Manager *m, const char *domain) { @@ -121,17 +117,13 @@ int manager_parse_search_domains_and_warn(Manager *m, const char *string) { _cleanup_free_ char *word = NULL; r = extract_first_word(&string, &word, NULL, EXTRACT_UNQUOTE); - if (r < 0) + if (r <= 0) return r; - if (r == 0) - break; r = manager_add_search_domain_by_string(m, word); if (r < 0) log_warning_errno(r, "Failed to add search domain '%s', ignoring: %m", word); } - - return 0; } int config_parse_dns_servers( |