sd-nework: be more careful with error codes, return ENODATA if you lack information
This commit is contained in:
parent
67272d157a
commit
31d2e1961a
|
@ -220,11 +220,12 @@ _public_ int sd_network_link_get_wildcard_domain(int ifindex) {
|
|||
return -ENOMEM;
|
||||
|
||||
r = parse_env_file(p, NEWLINE, "WILDCARD_DOMAIN", &s, NULL);
|
||||
if (r == -ENOENT)
|
||||
return -ENODATA;
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (!s)
|
||||
return -EIO;
|
||||
if (isempty(s))
|
||||
return -ENODATA;
|
||||
|
||||
return parse_boolean(s);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue