sd-nework: be more careful with error codes, return ENODATA if you lack information

This commit is contained in:
Lennart Poettering 2014-08-15 15:34:33 +02:00
parent 67272d157a
commit 31d2e1961a

View file

@ -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);
}