diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-08-15 15:34:33 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-08-15 15:34:33 +0200 |
commit | 31d2e1961aa05f1204090792e2acc27103de5bfd (patch) | |
tree | 6f7e31ec035c61d3396d54ff3f5b7a19b34caa07 /src/libsystemd | |
parent | 67272d157a35e5cda4e5c904eafdcc23d20541d1 (diff) |
sd-nework: be more careful with error codes, return ENODATA if you lack information
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-network/sd-network.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsystemd/sd-network/sd-network.c b/src/libsystemd/sd-network/sd-network.c index e30fc3cbf4..5d28af0344 100644 --- a/src/libsystemd/sd-network/sd-network.c +++ b/src/libsystemd/sd-network/sd-network.c @@ -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); } |