chiark / gitweb /
bus: change API to expose "inverted" no_reply and no_auto_start message flags non...
authorLennart Poettering <lennart@poettering.net>
Wed, 22 Jan 2014 19:45:05 +0000 (20:45 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 22 Jan 2014 19:45:05 +0000 (20:45 +0100)
TODO
src/libsystemd/libsystemd.sym
src/libsystemd/sd-bus/bus-control.c
src/libsystemd/sd-bus/bus-message.c
src/systemd/sd-bus.h

diff --git a/TODO b/TODO
index 583b42d..2cd4410 100644 (file)
--- a/TODO
+++ b/TODO
@@ -166,7 +166,6 @@ Features:
   - bus driver: GetNameOwner() for "org.freedesktop.DBus" should return "org.freedesktop.DBus"
   - update systemd.special(7) to mention that dbus.socket is only about the compatibility socket now
   - bus proxy should fake seclabel when connecting to kdbus
-  - sd_bus_message_set_no_reply() → sd_bus_message_set_expect_reply() and similar for no_auto_start
   - allow updating attach flags during runtime
   - pid1: peek into activating message when activating a service
   - when service activation failed, drop one message from the activator queue
index 984bc15..e2e917e 100644 (file)
@@ -85,8 +85,8 @@ global:
         sd_bus_message_get_type;
         sd_bus_message_get_cookie;
         sd_bus_message_get_reply_cookie;
-        sd_bus_message_get_no_reply;
-        sd_bus_message_get_no_auto_start;
+        sd_bus_message_get_expect_reply;
+        sd_bus_message_get_auto_start;
         sd_bus_message_get_priority;
         sd_bus_message_get_signature;
         sd_bus_message_get_path;
@@ -103,8 +103,8 @@ global:
         sd_bus_message_is_signal;
         sd_bus_message_is_method_call;
         sd_bus_message_is_method_error;
-        sd_bus_message_set_no_reply;
-        sd_bus_message_set_no_auto_start;
+        sd_bus_message_set_expect_reply;
+        sd_bus_message_set_auto_start;
         sd_bus_message_set_destination;
         sd_bus_message_set_priority;
         sd_bus_message_append;
index 5548239..61cdf22 100644 (file)
@@ -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;
 
index b42c491..4e95226 100644 (file)
@@ -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;
 }
index 01f6275..52481c6 100644 (file)
@@ -192,8 +192,8 @@ sd_bus* sd_bus_message_get_bus(sd_bus_message *m);
 int sd_bus_message_get_type(sd_bus_message *m, uint8_t *type);
 int sd_bus_message_get_cookie(sd_bus_message *m, uint64_t *cookie);
 int sd_bus_message_get_reply_cookie(sd_bus_message *m, uint64_t *cookie);
-int sd_bus_message_get_no_reply(sd_bus_message *m);
-int sd_bus_message_get_no_auto_start(sd_bus_message *m);
+int sd_bus_message_get_expect_reply(sd_bus_message *m);
+int sd_bus_message_get_auto_start(sd_bus_message *m);
 int sd_bus_message_get_priority(sd_bus_message *m, int64_t *priority);
 
 const char *sd_bus_message_get_signature(sd_bus_message *m, int complete);
@@ -215,8 +215,8 @@ int sd_bus_message_is_signal(sd_bus_message *m, const char *interface, const cha
 int sd_bus_message_is_method_call(sd_bus_message *m, const char *interface, const char *member);
 int sd_bus_message_is_method_error(sd_bus_message *m, const char *name);
 
-int sd_bus_message_set_no_reply(sd_bus_message *m, int b);
-int sd_bus_message_set_no_auto_start(sd_bus_message *m, int b);
+int sd_bus_message_set_expect_reply(sd_bus_message *m, int b);
+int sd_bus_message_set_auto_start(sd_bus_message *m, int b);
 int sd_bus_message_set_destination(sd_bus_message *m, const char *destination);
 int sd_bus_message_set_priority(sd_bus_message *m, int64_t priority);