summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/sd-bus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-03-31 16:46:21 +0200
committerLennart Poettering <lennart@poettering.net>2013-03-31 16:46:21 +0200
commit98178d3947d951ca001eaf400b5f362f458dceb5 (patch)
treea4345b294f68d22bd3eb84ca066420652e767d2f /src/libsystemd-bus/sd-bus.c
parent52f3ba915bdce4d7476c3ea53b8371deff5f567d (diff)
bus: rename sd_bus_get_peer() to sd_bus_get_server_id()
This function always returns the server side ID. The name suggested it was actually always the peer's ID, but that's not correct if the call is called on a server bus context. Hence, let's correct the name a bit.
Diffstat (limited to 'src/libsystemd-bus/sd-bus.c')
-rw-r--r--src/libsystemd-bus/sd-bus.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index 9b9281dde3..a71d7b5d77 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -200,16 +200,16 @@ int sd_bus_set_negotiate_fds(sd_bus *bus, int b) {
return 0;
}
-int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server) {
+int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server_id) {
if (!bus)
return -EINVAL;
- if (!b && !sd_id128_equal(server, SD_ID128_NULL))
+ if (!b && !sd_id128_equal(server_id, SD_ID128_NULL))
return -EINVAL;
if (bus->state != BUS_UNSET)
return -EPERM;
bus->is_server = !!b;
- bus->peer = server;
+ bus->server_id = server_id;
return 0;
}
@@ -604,7 +604,7 @@ static void bus_reset_parsed_address(sd_bus *b) {
free(b->exec_path);
b->exec_path = NULL;
b->exec_argv = NULL;
- b->peer = SD_ID128_NULL;
+ b->server_id = SD_ID128_NULL;
}
static int bus_parse_next_address(sd_bus *b) {
@@ -664,7 +664,7 @@ static int bus_parse_next_address(sd_bus *b) {
}
if (guid) {
- r = sd_id128_from_string(guid, &b->peer);
+ r = sd_id128_from_string(guid, &b->server_id);
if (r < 0)
return r;
}
@@ -907,19 +907,19 @@ int sd_bus_can_send(sd_bus *bus, char type) {
return bus_type_is_valid(type);
}
-int sd_bus_get_peer(sd_bus *bus, sd_id128_t *peer) {
+int sd_bus_get_server_id(sd_bus *bus, sd_id128_t *server_id) {
int r;
if (!bus)
return -EINVAL;
- if (!peer)
+ if (!server_id)
return -EINVAL;
r = bus_ensure_running(bus);
if (r < 0)
return r;
- *peer = bus->peer;
+ *server_id = bus->server_id;
return 0;
}