X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fresolve-host%2Fresolve-host.c;h=068756cab1ea55c61cffa0a777e2de4ae4388093;hb=ce06fdfb3de7a6591041828361f8d10c04a4677e;hp=49049d2a259a1f6009580423813d4a8539aff529;hpb=dad29dff1925a114e20d4eb7b47fca23c4f25fd7;p=elogind.git
diff --git a/src/resolve-host/resolve-host.c b/src/resolve-host/resolve-host.c
index 49049d2a2..068756cab 100644
--- a/src/resolve-host/resolve-host.c
+++ b/src/resolve-host/resolve-host.c
@@ -19,14 +19,12 @@
along with systemd; If not, see .
***/
-#include
#include
#include
#include "sd-bus.h"
#include "bus-util.h"
#include "bus-error.h"
-#include "bus-errors.h"
#include "in-addr-util.h"
#include "af-list.h"
#include "build.h"
@@ -155,7 +153,7 @@ static int resolve_host(sd_bus *bus, const char *name) {
r = in_addr_to_string(family, a, &pretty);
if (r < 0) {
- log_error("%s: failed to print address: %s", name, strerror(-r));
+ log_error_errno(r, "%s: failed to print address: %m", name);
continue;
}
@@ -513,10 +511,8 @@ static int parse_argv(int argc, char *argv[]) {
case 'i':
arg_ifindex = if_nametoindex(optarg);
- if (arg_ifindex <= 0) {
- log_error("Unknown interfaces %s: %m", optarg);
- return -errno;
- }
+ if (arg_ifindex <= 0)
+ return log_error_errno(errno, "Unknown interfaces %s: %m", optarg);
break;
case 't':
@@ -614,7 +610,7 @@ int main(int argc, char **argv) {
r = sd_bus_open_system(&bus);
if (r < 0) {
- log_error("sd_bus_open_system: %s", strerror(-r));
+ log_error_errno(r, "sd_bus_open_system: %m");
goto finish;
}