chiark / gitweb /
bus: rename send_hello flag to bus_cient
authorLennart Poettering <lennart@poettering.net>
Mon, 25 Mar 2013 23:36:43 +0000 (00:36 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 26 Mar 2013 01:19:34 +0000 (02:19 +0100)
This way we can hide more than just the hello logic behind this flag,
for example, later on automatic match management.

src/libsystemd-bus/bus-internal.h
src/libsystemd-bus/sd-bus.c
src/libsystemd-bus/sd-bus.h

index 78d955d00f2438f2d283b58584a10f336ebe1536..c25a208aea35ed59f5a76160d84329788ef6cd80 100644 (file)
@@ -72,7 +72,7 @@ struct sd_bus {
 
         bool negotiate_fds:1;
         bool can_fds:1;
-        bool send_hello:1;
+        bool bus_client:1;
         bool ucred_valid:1;
 
         void *rbuffer;
index 6eab4a5469cc44d4c71c401696594e5b643e3bd8..6a76db960dc42007c1a998c8daf52ae7bc670a38 100644 (file)
@@ -176,13 +176,13 @@ int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]) {
         return 0;
 }
 
-int sd_bus_set_hello(sd_bus *bus, int b) {
+int sd_bus_set_bus_client(sd_bus *bus, int b) {
         if (!bus)
                 return -EINVAL;
         if (bus->state != BUS_UNSET)
                 return -EPERM;
 
-        bus->send_hello = !!b;
+        bus->bus_client = !!b;
         return 0;
 }
 
@@ -230,7 +230,7 @@ static int bus_send_hello(sd_bus *bus) {
 
         assert(bus);
 
-        if (!bus->send_hello)
+        if (!bus->bus_client)
                 return 0;
 
         r = sd_bus_message_new_method_call(
@@ -253,7 +253,7 @@ static int bus_send_hello(sd_bus *bus) {
 int bus_start_running(sd_bus *bus) {
         assert(bus);
 
-        if (bus->send_hello) {
+        if (bus->bus_client) {
                 bus->state = BUS_HELLO;
                 return 1;
         }
@@ -753,7 +753,7 @@ int sd_bus_open_system(sd_bus **ret) {
                 b->sockaddr_size = offsetof(struct sockaddr_un, sun_path) + sizeof("/run/dbus/system_bus_socket") - 1;
         }
 
-        b->send_hello = true;
+        b->bus_client = true;
 
         r = sd_bus_start(b);
         if (r < 0)
@@ -803,7 +803,7 @@ int sd_bus_open_user(sd_bus **ret) {
                 b->sockaddr_size = offsetof(struct sockaddr_un, sun_path) + l + 4;
         }
 
-        b->send_hello = true;
+        b->bus_client = true;
 
         r = sd_bus_start(b);
         if (r < 0)
index a15cc26e3f0acca20974318e09229acd23a2f6fa..d680270c6423a8306ed9a0651a33257b2ee6577e 100644 (file)
@@ -31,6 +31,7 @@
 /* TODO:
  * - implicitly add stub introspection calls
  * - server side
+ * - allow installing match callbacks,
  *
  * Later:
  * - add page donation logic
@@ -58,7 +59,7 @@ int sd_bus_new(sd_bus **ret);
 int sd_bus_set_address(sd_bus *bus, const char *address);
 int sd_bus_set_fd(sd_bus *bus, int fd);
 int sd_bus_set_exec(sd_bus *bus, const char *path, char *const argv[]);
-int sd_bus_set_hello(sd_bus *bus, int b);
+int sd_bus_set_bus_client(sd_bus *bus, int b);
 int sd_bus_set_negotiate_fds(sd_bus *bus, int b);
 int sd_bus_start(sd_bus *ret);