summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-15 15:34:33 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-15 15:34:33 +0200
commit31d2e1961aa05f1204090792e2acc27103de5bfd (patch)
tree6f7e31ec035c61d3396d54ff3f5b7a19b34caa07 /src
parent67272d157a35e5cda4e5c904eafdcc23d20541d1 (diff)
sd-nework: be more careful with error codes, return ENODATA if you lack information
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd/sd-network/sd-network.c7
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);
}