From: Reverend Homer Date: Mon, 22 Jan 2018 15:04:44 +0000 (+0300) Subject: systemctl: replace manual GetAll call with bus_map_all_properties() in unit_exists() X-Git-Tag: v237~58 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=98f609368723529a98f44948569fd2eb2dd9685d;p=thirdparty%2Fsystemd.git systemctl: replace manual GetAll call with bus_map_all_properties() in unit_exists() --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index e44241fd3aa..e5e3803f84e 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -6270,22 +6270,10 @@ static int unit_exists(LookupPaths *lp, const char *unit) { if (r < 0) return r; - r = sd_bus_call_method( - bus, - "org.freedesktop.systemd1", - path, - "org.freedesktop.DBus.Properties", - "GetAll", - &error, - &reply, - "s", ""); + r = bus_map_all_properties(bus, "org.freedesktop.systemd1", path, property_map, &error, &info); if (r < 0) return log_error_errno(r, "Failed to get properties: %s", bus_error_message(&error, r)); - r = bus_message_map_all_properties(reply, property_map, &error, &info); - if (r < 0) - return log_error_errno(r, "Failed to map properties: %s", bus_error_message(&error, r)); - return !streq_ptr(info.load_state, "not-found") || !streq_ptr(info.active_state, "inactive"); }