From 6a7a4e4d0a057febab787a2d5d3e0b52d2db2268 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 21 Apr 2015 17:40:18 +0200 Subject: networkd: improve how networkd logs things This makes adds a couple of fixes: - Introduces log_netdev_error_errno() and friends, which takes an error number, and matches what log_link_error_errno() and friends do. - Replaces a lof ot strerror() usage with log_netdev_error_errno(), log_link_error_errno() and log_erro_errno() - Uppercases the first character of many log messages, after all this is supposed to be english language - Drops manual negating of error codes before passing them to log functions, the log functions all do that internally anyway. Some other minor fixes. Behaviour should not change really. --- src/network/networkd-address.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/network/networkd-address.c') diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 85acc49945..a3aa1f7fdb 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -274,10 +274,8 @@ static int address_acquire(Link *link, Address *original, Address **ret) { /* The address is configured to be 0.0.0.0 or [::] by the user? * Then let's acquire something more useful from the pool. */ r = manager_address_pool_acquire(link->manager, original->family, original->prefixlen, &in_addr); - if (r < 0) { - log_link_error(link, "Failed to acquire address from pool: %s", strerror(-r)); - return r; - } + if (r < 0) + return log_link_error_errno(link, r, "Failed to acquire address from pool: %m"); if (r == 0) { log_link_error(link, "Couldn't find free address for interface, all taken."); return -EBUSY; -- cgit v1.2.3-54-g00ecf