summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-22 20:45:05 +0100
committerLennart Poettering <lennart@poettering.net>2014-01-22 20:45:05 +0100
commiteee9ec0e28922b6991a6eea64fd7ce54df1cd364 (patch)
tree7ae21c67527f91102706d301ced34e3880c5c308 /src/libsystemd/sd-bus
parentab9716c2489f9141ed13ec22dbb216b3e6fbd6b5 (diff)
bus: change API to expose "inverted" no_reply and no_auto_start message flags non-inverted
Diffstat (limited to 'src/libsystemd/sd-bus')
-rw-r--r--src/libsystemd/sd-bus/bus-control.c2
-rw-r--r--src/libsystemd/sd-bus/bus-message.c21
2 files changed, 12 insertions, 11 deletions
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
index 5548239426..61cdf2249e 100644
--- a/src/libsystemd/sd-bus/bus-control.c
+++ b/src/libsystemd/sd-bus/bus-control.c
@@ -1214,7 +1214,7 @@ _public_ int sd_bus_get_owner_machine_id(sd_bus *bus, const char *name, sd_id128
if (r < 0)
return r;
- r = sd_bus_message_set_no_auto_start(m, true);
+ r = sd_bus_message_set_auto_start(m, false);
if (r < 0)
return r;
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index b42c4915ea..4e95226c5d 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -831,16 +831,17 @@ _public_ int sd_bus_message_get_reply_cookie(sd_bus_message *m, uint64_t *cookie
return 0;
}
-_public_ int sd_bus_message_get_no_reply(sd_bus_message *m) {
+_public_ int sd_bus_message_get_expect_reply(sd_bus_message *m) {
assert_return(m, -EINVAL);
- return m->header->type == SD_BUS_MESSAGE_METHOD_CALL ? !!(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) : 0;
+ return m->header->type == SD_BUS_MESSAGE_METHOD_CALL &&
+ !(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED);
}
-_public_ int sd_bus_message_get_no_auto_start(sd_bus_message *m) {
+_public_ int sd_bus_message_get_auto_start(sd_bus_message *m) {
assert_return(m, -EINVAL);
- return !!(m->header->flags & BUS_MESSAGE_NO_AUTO_START);
+ return !(m->header->flags & BUS_MESSAGE_NO_AUTO_START);
}
_public_ const char *sd_bus_message_get_path(sd_bus_message *m) {
@@ -968,27 +969,27 @@ _public_ int sd_bus_message_is_method_error(sd_bus_message *m, const char *name)
return 1;
}
-_public_ int sd_bus_message_set_no_reply(sd_bus_message *m, int b) {
+_public_ int sd_bus_message_set_expect_reply(sd_bus_message *m, int b) {
assert_return(m, -EINVAL);
assert_return(!m->sealed, -EPERM);
assert_return(m->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EPERM);
if (b)
- m->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED;
- else
m->header->flags &= ~BUS_MESSAGE_NO_REPLY_EXPECTED;
+ else
+ m->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED;
return 0;
}
-_public_ int sd_bus_message_set_no_auto_start(sd_bus_message *m, int b) {
+_public_ int sd_bus_message_set_auto_start(sd_bus_message *m, int b) {
assert_return(m, -EINVAL);
assert_return(!m->sealed, -EPERM);
if (b)
- m->header->flags |= BUS_MESSAGE_NO_AUTO_START;
- else
m->header->flags &= ~BUS_MESSAGE_NO_AUTO_START;
+ else
+ m->header->flags |= BUS_MESSAGE_NO_AUTO_START;
return 0;
}