summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Stelmach <l.stelmach@samsung.com>2015-09-23 17:20:59 +0200
committerŁukasz Stelmach <l.stelmach@samsung.com>2015-10-06 17:56:19 +0200
commit6cdf0399f3f2b7302a79f979cbe160531bd4049a (patch)
tree810b68e96c29c40039c4fe1fbf7fd171201c1ea4
parent19f462f2de4d5513111974dad90b0eb83ae02f9d (diff)
analyze: do not require information from hostnamed
-rw-r--r--src/analyze/analyze.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index 043f919a8c..ae376a9553 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -436,6 +436,7 @@ fail:
static int acquire_host_info(sd_bus *bus, struct host_info **hi) {
int r;
struct host_info *host;
+ _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
static const struct bus_properties_map hostname_map[] = {
{ "Hostname", "s", NULL, offsetof(struct host_info, hostname) },
@@ -462,21 +463,22 @@ static int acquire_host_info(sd_bus *bus, struct host_info **hi) {
hostname_map,
host);
if (r < 0)
- goto fail;
+ log_debug_errno(r, "Failed to get host information from systemd-hostnamed: %s",
+ bus_error_message(&error, r));
r = bus_map_all_properties(bus,
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
manager_map,
host);
- if (r < 0)
- goto fail;
+ if (r < 0) {
+ free_host_info(host);
+ return log_error_errno(r, "Failed to get host information from systemd: %s",
+ bus_error_message(&error, r));
+ }
*hi = host;
return 0;
-fail:
- free_host_info(host);
- return r;
}
static int pretty_boot_time(sd_bus *bus, char **_buf) {