sd-bus: rename sd_bus_get_server_id() to sd_bus_get_owner_id()

In kdbus a "server id" is mostly a misnomer, as there isn't any "server"
involved anymore. Let's rename this to "owner" id hence, since it is an
ID that is picked by the owner of a bus or direct connection. This
matches nicely the sd_bus_get_owner_creds() call we already have.
This commit is contained in:
Lennart Poettering 2014-11-04 17:24:30 +01:00
parent f4b2933ee7
commit f7fce3454c
5 changed files with 10 additions and 11 deletions

View File

@ -676,7 +676,7 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m) {
sd_id128_t server_id;
char buf[SD_ID128_STRING_MAX];
r = sd_bus_get_server_id(a, &server_id);
r = sd_bus_get_owner_id(a, &server_id);
if (r < 0)
return synthetic_reply_method_errno(m, r, NULL);
@ -1230,7 +1230,7 @@ int main(int argc, char *argv[]) {
goto finish;
}
r = sd_bus_get_server_id(a, &server_id);
r = sd_bus_get_owner_id(a, &server_id);
if (r < 0) {
log_error("Failed to get server ID: %s", strerror(-r));
goto finish;

View File

@ -190,7 +190,7 @@ global:
sd_bus_unref;
sd_bus_is_open;
sd_bus_can_send;
sd_bus_get_server_id;
sd_bus_get_owner_id;
sd_bus_get_owner_creds;
sd_bus_get_description;
sd_bus_send;

View File

@ -1412,18 +1412,18 @@ _public_ int sd_bus_can_send(sd_bus *bus, char type) {
return bus_type_is_valid(type);
}
_public_ int sd_bus_get_server_id(sd_bus *bus, sd_id128_t *server_id) {
_public_ int sd_bus_get_owner_id(sd_bus *bus, sd_id128_t *id) {
int r;
assert_return(bus, -EINVAL);
assert_return(server_id, -EINVAL);
assert_return(id, -EINVAL);
assert_return(!bus_pid_changed(bus), -ECHILD);
r = bus_ensure_running(bus);
if (r < 0)
return r;
*server_id = bus->server_id;
*id = bus->server_id;
return 0;
}

View File

@ -78,7 +78,7 @@ static int server_init(sd_bus **_bus) {
goto fail;
}
r = sd_bus_get_server_id(bus, &id);
r = sd_bus_get_owner_id(bus, &id);
if (r < 0) {
log_error("Failed to get server ID: %s", strerror(-r));
goto fail;

View File

@ -112,7 +112,7 @@ int sd_bus_set_address(sd_bus *bus, const char *address);
int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd);
int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]);
int sd_bus_set_bus_client(sd_bus *bus, int b);
int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server_id);
int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t owner_id);
int sd_bus_set_anonymous(sd_bus *bus, int b);
int sd_bus_set_trusted(sd_bus *bus, int b);
int sd_bus_set_description(sd_bus *bus, const char *description);
@ -130,7 +130,7 @@ sd_bus *sd_bus_unref(sd_bus *bus);
int sd_bus_is_open(sd_bus *bus);
int sd_bus_can_send(sd_bus *bus, char type);
int sd_bus_get_server_id(sd_bus *bus, sd_id128_t *peer);
int sd_bus_get_owner_id(sd_bus *bus, sd_id128_t *id);
int sd_bus_get_owner_creds(sd_bus *bus, uint64_t creds_mask, sd_bus_creds **ret);
int sd_bus_get_description(sd_bus *bus, const char **description);
int sd_bus_get_tid(sd_bus *bus, pid_t *tid);
@ -147,6 +147,7 @@ int sd_bus_process(sd_bus *bus, sd_bus_message **r);
int sd_bus_process_priority(sd_bus *bus, int64_t max_priority, sd_bus_message **r);
int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec);
int sd_bus_flush(sd_bus *bus);
sd_bus_slot* sd_bus_get_current_slot(sd_bus *bus);
sd_bus_message* sd_bus_get_current_message(sd_bus *bus);
sd_bus_message_handler_t sd_bus_get_current_handler(sd_bus *bus);
@ -171,10 +172,8 @@ sd_bus_slot* sd_bus_slot_ref(sd_bus_slot *slot);
sd_bus_slot* sd_bus_slot_unref(sd_bus_slot *slot);
sd_bus* sd_bus_slot_get_bus(sd_bus_slot *slot);
void *sd_bus_slot_get_userdata(sd_bus_slot *slot);
void *sd_bus_slot_set_userdata(sd_bus_slot *slot, void *userdata);
int sd_bus_slot_set_description(sd_bus_slot *slot, const char *description);
int sd_bus_slot_get_description(sd_bus_slot *slot, char **description);