summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-11 18:55:34 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-12 00:12:43 +0100
commitc49b30a23583ff39daaa26696bcab478d2fee0bb (patch)
tree960176d9d201122ab61763fca610f632468a09fe
parent1823b86ebf955b737fb87372b211fa45ba799a48 (diff)
bus: rename sd_bus_send_with_reply_and_block() to sd_bus_call()
The call is one of the most important ones we expose, where we place major emphasis on. We should make sure to give it a short, memorable name.
-rw-r--r--src/libsystemd-bus/bus-convenience.c4
-rw-r--r--src/libsystemd-bus/bus-util.c4
-rw-r--r--src/libsystemd-bus/sd-bus.c12
-rw-r--r--src/libsystemd-bus/test-bus-chat.c6
-rw-r--r--src/libsystemd-bus/test-bus-kernel-benchmark.c2
-rw-r--r--src/libsystemd-bus/test-bus-server.c2
-rw-r--r--src/locale/localectl.c2
-rw-r--r--src/locale/localed.c2
-rw-r--r--src/login/logind-dbus.c2
-rw-r--r--src/machine/machined-dbus.c2
-rw-r--r--src/run/run.c2
-rw-r--r--src/systemctl/systemctl.c6
-rw-r--r--src/systemd/sd-bus.h6
13 files changed, 26 insertions, 26 deletions
diff --git a/src/libsystemd-bus/bus-convenience.c b/src/libsystemd-bus/bus-convenience.c
index 4dc65b9718..9bf2e2cbe5 100644
--- a/src/libsystemd-bus/bus-convenience.c
+++ b/src/libsystemd-bus/bus-convenience.c
@@ -87,7 +87,7 @@ _public_ int sd_bus_call_method(
return r;
}
- return sd_bus_send_with_reply_and_block(bus, m, 0, error, reply);
+ return sd_bus_call(bus, m, 0, error, reply);
}
_public_ int sd_bus_reply_method_return(
@@ -422,5 +422,5 @@ _public_ int sd_bus_set_property(
if (r < 0)
return r;
- return sd_bus_send_with_reply_and_block(bus, m, 0, error, NULL);
+ return sd_bus_call(bus, m, 0, error, NULL);
}
diff --git a/src/libsystemd-bus/bus-util.c b/src/libsystemd-bus/bus-util.c
index e92c3187eb..d277e1e0f0 100644
--- a/src/libsystemd-bus/bus-util.c
+++ b/src/libsystemd-bus/bus-util.c
@@ -236,7 +236,7 @@ static void async_polkit_query_free(sd_bus *b, AsyncPolkitQuery *q) {
return;
if (q->serial > 0 && b)
- sd_bus_send_with_reply_cancel(b, q->serial);
+ sd_bus_call_async_cancel(b, q->serial);
sd_bus_message_unref(q->request);
sd_bus_message_unref(q->reply);
@@ -362,7 +362,7 @@ int bus_verify_polkit_async(
return r;
}
- r = sd_bus_send_with_reply(bus, pk, async_polkit_callback, q, 0, &q->serial);
+ r = sd_bus_call_async(bus, pk, async_polkit_callback, q, 0, &q->serial);
if (r < 0)
return r;
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index fceab505ac..fdfbbeb2be 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -396,7 +396,7 @@ static int bus_send_hello(sd_bus *bus) {
if (r < 0)
return r;
- return sd_bus_send_with_reply(bus, m, hello_callback, NULL, 0, &bus->hello_serial);
+ return sd_bus_call_async(bus, m, hello_callback, NULL, 0, &bus->hello_serial);
}
int bus_start_running(sd_bus *bus) {
@@ -1440,7 +1440,7 @@ static int timeout_compare(const void *a, const void *b) {
return 0;
}
-_public_ int sd_bus_send_with_reply(
+_public_ int sd_bus_call_async(
sd_bus *bus,
sd_bus_message *m,
sd_bus_message_handler_t callback,
@@ -1492,21 +1492,21 @@ _public_ int sd_bus_send_with_reply(
r = prioq_put(bus->reply_callbacks_prioq, c, &c->prioq_idx);
if (r < 0) {
c->timeout = 0;
- sd_bus_send_with_reply_cancel(bus, c->serial);
+ sd_bus_call_async_cancel(bus, c->serial);
return r;
}
}
r = sd_bus_send(bus, m, serial);
if (r < 0) {
- sd_bus_send_with_reply_cancel(bus, c->serial);
+ sd_bus_call_async_cancel(bus, c->serial);
return r;
}
return r;
}
-_public_ int sd_bus_send_with_reply_cancel(sd_bus *bus, uint64_t serial) {
+_public_ int sd_bus_call_async_cancel(sd_bus *bus, uint64_t serial) {
struct reply_callback *c;
assert_return(bus, -EINVAL);
@@ -1549,7 +1549,7 @@ int bus_ensure_running(sd_bus *bus) {
}
}
-_public_ int sd_bus_send_with_reply_and_block(
+_public_ int sd_bus_call(
sd_bus *bus,
sd_bus_message *m,
uint64_t usec,
diff --git a/src/libsystemd-bus/test-bus-chat.c b/src/libsystemd-bus/test-bus-chat.c
index a29fbdf9c4..67411f1184 100644
--- a/src/libsystemd-bus/test-bus-chat.c
+++ b/src/libsystemd-bus/test-bus-chat.c
@@ -437,7 +437,7 @@ static void* client2(void*p) {
goto finish;
}
- r = sd_bus_send_with_reply_and_block(bus, m, 0, &error, &reply);
+ r = sd_bus_call(bus, m, 0, &error, &reply);
if (r < 0) {
log_error("Failed to issue method call: %s", bus_error_message(&error, -r));
goto finish;
@@ -469,7 +469,7 @@ static void* client2(void*p) {
sd_bus_message_unref(reply);
reply = NULL;
- r = sd_bus_send_with_reply_and_block(bus, m, 200 * USEC_PER_MSEC, &error, &reply);
+ r = sd_bus_call(bus, m, 200 * USEC_PER_MSEC, &error, &reply);
if (r < 0)
log_info("Failed to issue method call: %s", bus_error_message(&error, -r));
else
@@ -490,7 +490,7 @@ static void* client2(void*p) {
goto finish;
}
- r = sd_bus_send_with_reply(bus, m, quit_callback, &quit, 200 * USEC_PER_MSEC, NULL);
+ r = sd_bus_call_async(bus, m, quit_callback, &quit, 200 * USEC_PER_MSEC, NULL);
if (r < 0) {
log_info("Failed to issue method call: %s", bus_error_message(&error, -r));
goto finish;
diff --git a/src/libsystemd-bus/test-bus-kernel-benchmark.c b/src/libsystemd-bus/test-bus-kernel-benchmark.c
index 666c74cea3..18b08ed816 100644
--- a/src/libsystemd-bus/test-bus-kernel-benchmark.c
+++ b/src/libsystemd-bus/test-bus-kernel-benchmark.c
@@ -82,7 +82,7 @@ static void transaction(sd_bus *b, size_t sz) {
memset(p, 0x80, sz);
- assert_se(sd_bus_send_with_reply_and_block(b, m, 0, NULL, &reply) >= 0);
+ assert_se(sd_bus_call(b, m, 0, NULL, &reply) >= 0);
}
static void client_bisect(const char *address) {
diff --git a/src/libsystemd-bus/test-bus-server.c b/src/libsystemd-bus/test-bus-server.c
index 478a81e5cb..a9db1f4101 100644
--- a/src/libsystemd-bus/test-bus-server.c
+++ b/src/libsystemd-bus/test-bus-server.c
@@ -151,7 +151,7 @@ static int client(struct context *c) {
return r;
}
- r = sd_bus_send_with_reply_and_block(bus, m, 0, &error, &reply);
+ r = sd_bus_call(bus, m, 0, &error, &reply);
if (r < 0) {
log_error("Failed to issue method call: %s", bus_error_message(&error, -r));
return r;
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index ed66668f79..d8dd66a197 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -164,7 +164,7 @@ static int set_locale(sd_bus *bus, char **args, unsigned n) {
if (r < 0)
return bus_log_create_error(r);
- r = sd_bus_send_with_reply_and_block(bus, m, 0, &error, NULL);
+ r = sd_bus_call(bus, m, 0, &error, NULL);
if (r < 0) {
log_error("Failed to issue method call: %s", bus_error_message(&error, -r));
return r;
diff --git a/src/locale/localed.c b/src/locale/localed.c
index 744d304c6d..7e03d82575 100644
--- a/src/locale/localed.c
+++ b/src/locale/localed.c
@@ -382,7 +382,7 @@ static int locale_update_system_manager(Context *c, sd_bus *bus) {
if (r < 0)
return r;
- r = sd_bus_send_with_reply_and_block(bus, m, 0, &error, NULL);
+ r = sd_bus_call(bus, m, 0, &error, NULL);
if (r < 0)
log_error("Failed to update the manager environment: %s", strerror(-r));
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 7e22b842a4..0f25e2306f 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -2216,7 +2216,7 @@ int manager_start_scope(
if (r < 0)
return r;
- r = sd_bus_send_with_reply_and_block(manager->bus, m, 0, error, &reply);
+ r = sd_bus_call(manager->bus, m, 0, error, &reply);
if (r < 0)
return r;
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index 71f985345a..2b25f07525 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -529,7 +529,7 @@ int manager_start_scope(
if (r < 0)
return r;
- r = sd_bus_send_with_reply_and_block(manager->bus, m, 0, error, &reply);
+ r = sd_bus_call(manager->bus, m, 0, error, &reply);
if (r < 0)
return r;
diff --git a/src/run/run.c b/src/run/run.c
index 1eeb5c6e56..539db6f494 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -237,7 +237,7 @@ static int message_start_transient_unit_send(sd_bus *bus, sd_bus_message *m, sd_
if (r < 0)
return r;
- return sd_bus_send_with_reply_and_block(bus, m, 0, error, reply);
+ return sd_bus_call(bus, m, 0, error, reply);
}
static int start_transient_service(
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 0e833ab538..8b6dae27b8 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3845,7 +3845,7 @@ static int set_property(sd_bus *bus, char **args) {
if (r < 0)
return bus_log_create_error(r);
- r = sd_bus_send_with_reply_and_block(bus, m, -1, &error, NULL);
+ r = sd_bus_call(bus, m, 0, &error, NULL);
if (r < 0) {
log_error("Failed to set unit properties on %s: %s", n, bus_error_message(&error, r));
return r;
@@ -4132,7 +4132,7 @@ static int set_environment(sd_bus *bus, char **args) {
if (r < 0)
return bus_log_create_error(r);
- r = sd_bus_send_with_reply_and_block(bus, m, -1, &error, NULL);
+ r = sd_bus_call(bus, m, 0, &error, NULL);
if (r < 0) {
log_error("Failed to set environment: %s", bus_error_message(&error, r));
return r;
@@ -4443,7 +4443,7 @@ static int enable_unit(sd_bus *bus, char **args) {
return bus_log_create_error(r);
}
- r = sd_bus_send_with_reply_and_block(bus, m, -0, &error, &reply);
+ r = sd_bus_call(bus, m, 0, &error, &reply);
if (r < 0) {
log_error("Failed to execute operation: %s", bus_error_message(&error, r));
return r;
diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h
index 6202acb659..b31cfaab6f 100644
--- a/src/systemd/sd-bus.h
+++ b/src/systemd/sd-bus.h
@@ -89,9 +89,9 @@ 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_send(sd_bus *bus, sd_bus_message *m, uint64_t *serial);
-int sd_bus_send_with_reply(sd_bus *bus, sd_bus_message *m, sd_bus_message_handler_t callback, void *userdata, uint64_t usec, uint64_t *serial);
-int sd_bus_send_with_reply_cancel(sd_bus *bus, uint64_t serial);
-int sd_bus_send_with_reply_and_block(sd_bus *bus, sd_bus_message *m, uint64_t usec, sd_bus_error *error, sd_bus_message **r);
+int sd_bus_call(sd_bus *bus, sd_bus_message *m, uint64_t usec, sd_bus_error *error, sd_bus_message **reply);
+int sd_bus_call_async(sd_bus *bus, sd_bus_message *m, sd_bus_message_handler_t callback, void *userdata, uint64_t usec, uint64_t *serial);
+int sd_bus_call_async_cancel(sd_bus *bus, uint64_t serial);
int sd_bus_get_fd(sd_bus *bus);
int sd_bus_get_events(sd_bus *bus);