From 31d2e1961aa05f1204090792e2acc27103de5bfd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 15 Aug 2014 15:34:33 +0200 Subject: [PATCH] sd-nework: be more careful with error codes, return ENODATA if you lack information --- src/libsystemd/sd-network/sd-network.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libsystemd/sd-network/sd-network.c b/src/libsystemd/sd-network/sd-network.c index e30fc3cbf42..5d28af0344b 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); }