_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_strv_free_ char **ret = NULL;
- _cleanup_free_ char *path = NULL;
+ _cleanup_free_ char *dbus_path = NULL;
int i, r;
assert(bus);
assert(name);
assert(deps);
- path = unit_dbus_path_from_name(name);
- if (!path)
+ dbus_path = unit_dbus_path_from_name(name);
+ if (!dbus_path)
return log_oom();
r = bus_map_all_properties(bus,
"org.freedesktop.systemd1",
- path,
+ dbus_path,
map[arg_dependency],
BUS_MAP_STRDUP,
&error,
!install_client_side() &&
!unit_name_is_valid(unit_name, UNIT_NAME_TEMPLATE)) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
- _cleanup_free_ char *load_state = NULL, *unit = NULL;
+ _cleanup_free_ char *load_state = NULL, *dbus_path = NULL;
- unit = unit_dbus_path_from_name(unit_name);
- if (!unit)
+ dbus_path = unit_dbus_path_from_name(unit_name);
+ if (!dbus_path)
return log_oom();
r = sd_bus_get_property_string(
bus,
"org.freedesktop.systemd1",
- unit,
+ dbus_path,
"org.freedesktop.systemd1.Unit",
"LoadState",
&error,
r = sd_bus_get_property_string(
bus,
"org.freedesktop.systemd1",
- unit,
+ dbus_path,
"org.freedesktop.systemd1.Unit",
"FragmentPath",
&error,
r = sd_bus_get_property_strv(
bus,
"org.freedesktop.systemd1",
- unit,
+ dbus_path,
"org.freedesktop.systemd1.Unit",
"DropInPaths",
&error,
}
}
+ if (isempty(path)) {
+ *ret_fragment_path = NULL;
r = 0;
-
- if (!isempty(path)) {
+ } else {
*ret_fragment_path = TAKE_PTR(path);
r = 1;
- } else
- *ret_fragment_path = NULL;
+ }
if (ret_dropin_paths) {
if (!strv_isempty(dropins)) {
static int get_state_one_unit(sd_bus *bus, const char *name, UnitActiveState *active_state) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
- _cleanup_free_ char *buf = NULL, *path = NULL;
+ _cleanup_free_ char *buf = NULL, *dbus_path = NULL;
UnitActiveState state;
int r;
assert(name);
assert(active_state);
- path = unit_dbus_path_from_name(name);
- if (!path)
+ dbus_path = unit_dbus_path_from_name(name);
+ if (!dbus_path)
return log_oom();
r = sd_bus_get_property_string(
bus,
"org.freedesktop.systemd1",
- path,
+ dbus_path,
"org.freedesktop.systemd1.Unit",
"ActiveState",
&error,
static int check_triggering_units(sd_bus *bus, const char *name) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
- _cleanup_free_ char *n = NULL, *path = NULL, *load_state = NULL;
+ _cleanup_free_ char *n = NULL, *dbus_path = NULL, *load_state = NULL;
_cleanup_strv_free_ char **triggered_by = NULL;
bool print_warning_label = true;
UnitActiveState active_state;
if (streq(load_state, "masked"))
return 0;
- path = unit_dbus_path_from_name(n);
- if (!path)
+ dbus_path = unit_dbus_path_from_name(n);
+ if (!dbus_path)
return log_oom();
r = sd_bus_get_property_strv(
bus,
"org.freedesktop.systemd1",
- path,
+ dbus_path,
"org.freedesktop.systemd1.Unit",
"TriggeredBy",
&error,