mirror of
https://github.com/systemd/systemd.git
synced 2025-01-12 13:18:14 +03:00
tree-wide: use public sd-bus functions in more places
This commit is contained in:
parent
d2916409ed
commit
5453a4b1a8
@ -1274,7 +1274,7 @@ static int monitor(int argc, char **argv, int (*dump)(sd_bus_message *m, FILE *f
|
||||
STRV_FOREACH(i, argv+1) {
|
||||
_cleanup_free_ char *m = NULL;
|
||||
|
||||
if (!service_name_is_valid(*i))
|
||||
if (!sd_bus_service_name_is_valid(*i))
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Invalid service name '%s'", *i);
|
||||
|
||||
m = strjoin("sender='", *i, "'");
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "bus-common-errors.h"
|
||||
#include "bus-internal.h"
|
||||
#include "bus-util.h"
|
||||
#include "dbus-cgroup.h"
|
||||
#include "dbus-kill.h"
|
||||
@ -140,7 +139,7 @@ static int bus_scope_set_transient_property(
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (!isempty(controller) && !service_name_is_valid(controller))
|
||||
if (!isempty(controller) && !sd_bus_service_name_is_valid(controller))
|
||||
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Controller '%s' is not a valid bus name.", controller);
|
||||
|
||||
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "async.h"
|
||||
#include "bus-internal.h"
|
||||
#include "bus-util.h"
|
||||
#include "dbus-cgroup.h"
|
||||
#include "dbus-execute.h"
|
||||
@ -258,7 +257,7 @@ static BUS_DEFINE_SET_TRANSIENT_PARSE(notify_access, NotifyAccess, notify_access
|
||||
static BUS_DEFINE_SET_TRANSIENT_PARSE(service_type, ServiceType, service_type_from_string);
|
||||
static BUS_DEFINE_SET_TRANSIENT_PARSE(service_restart, ServiceRestart, service_restart_from_string);
|
||||
static BUS_DEFINE_SET_TRANSIENT_PARSE(oom_policy, OOMPolicy, oom_policy_from_string);
|
||||
static BUS_DEFINE_SET_TRANSIENT_STRING_WITH_CHECK(bus_name, service_name_is_valid);
|
||||
static BUS_DEFINE_SET_TRANSIENT_STRING_WITH_CHECK(bus_name, sd_bus_service_name_is_valid);
|
||||
|
||||
static int bus_service_set_transient_property(
|
||||
Service *s,
|
||||
|
@ -1948,7 +1948,7 @@ int config_parse_bus_name(
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!service_name_is_valid(k)) {
|
||||
if (!sd_bus_service_name_is_valid(k)) {
|
||||
log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid bus name, ignoring: %s", k);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1156,7 +1156,7 @@ int bus_path_encode_unique(sd_bus *b, const char *prefix, const char *sender_id,
|
||||
int r;
|
||||
|
||||
assert_return(b || (sender_id && external_id), -EINVAL);
|
||||
assert_return(object_path_is_valid(prefix), -EINVAL);
|
||||
assert_return(sd_bus_object_path_is_valid(prefix), -EINVAL);
|
||||
assert_return(ret_path, -EINVAL);
|
||||
|
||||
if (!sender_id) {
|
||||
@ -1208,8 +1208,8 @@ int bus_path_decode_unique(const char *path, const char *prefix, char **ret_send
|
||||
const char *p, *q;
|
||||
char *sender, *external;
|
||||
|
||||
assert(object_path_is_valid(path));
|
||||
assert(object_path_is_valid(prefix));
|
||||
assert(sd_bus_object_path_is_valid(path));
|
||||
assert(sd_bus_object_path_is_valid(prefix));
|
||||
assert(ret_sender);
|
||||
assert(ret_external);
|
||||
|
||||
@ -1670,7 +1670,7 @@ int bus_introspect_implementations(
|
||||
}
|
||||
|
||||
struct introspect intro = {};
|
||||
bool is_interface = interface_name_is_valid(pattern);
|
||||
bool is_interface = sd_bus_interface_name_is_valid(pattern);
|
||||
|
||||
impl = find_implementation(pattern, bus_objects);
|
||||
if (!impl)
|
||||
|
Loading…
Reference in New Issue
Block a user