summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Marineau <michael.marineau@coreos.com>2014-07-22 01:23:42 +0200
committerTom Gundersen <teg@jklm.no>2014-07-29 22:24:58 +0200
commit70b34f5de86809991d6753ba486b88481ceab817 (patch)
treef2606924a7c75f1fde9f756684836d4619945a02
parentresolved: discard more invalid llmnr messages (diff)
downloadsystemd-70b34f5de86809991d6753ba486b88481ceab817.tar.xz
systemd-70b34f5de86809991d6753ba486b88481ceab817.zip
networkd: fix reporting errors from hostnamed
The return value may be -EINVAL or a positive errno from the dbus message. Check both ranges, otherwise most errors are silently ignored.
-rw-r--r--src/network/networkd-link.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 3b8b7ed80e..7db71c0b70 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -835,7 +835,9 @@ static int set_hostname_handler(sd_bus *bus, sd_bus_message *m, void *userdata,
r = sd_bus_message_get_errno(m);
if (r < 0)
- log_warning_link(link, "Could not set hostname: %s", strerror(-r));
+ r = -r;
+ if (r > 0)
+ log_warning_link(link, "Could not set hostname: %s", strerror(r));
return 1;
}