diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-11-30 00:19:01 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-11-30 00:21:06 +0100 |
commit | 7adc46fcce257fcf4c83faa18b8c78f2a577e4f1 (patch) | |
tree | 073a6435743ed0f65abb895a9bd3049b9f136408 /src/libsystemd-bus/bus-socket.c | |
parent | dff55e5db393af91e912e509aac349cff4786de3 (diff) |
bus: don't generate NameAcquired/NameLost messages in the library
The signals appear entirely redundant due to NameOwnerChange, hence
don't do them in the new library, instead leave them for the
compatibility bridge only.
Also, set the serial number for synthesized messages to (uint32_t) -1.
Diffstat (limited to 'src/libsystemd-bus/bus-socket.c')
-rw-r--r-- | src/libsystemd-bus/bus-socket.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/libsystemd-bus/bus-socket.c b/src/libsystemd-bus/bus-socket.c index 355f31c562..d7d3b4dac5 100644 --- a/src/libsystemd-bus/bus-socket.c +++ b/src/libsystemd-bus/bus-socket.c @@ -900,6 +900,10 @@ static int bus_socket_make_message(sd_bus *bus, size_t size) { assert(bus->rbuffer_size >= size); assert(bus->state == BUS_RUNNING || bus->state == BUS_HELLO); + r = bus_rqueue_make_room(bus); + if (r < 0) + return r; + if (bus->rbuffer_size > size) { b = memdup((const uint8_t*) bus->rbuffer + size, bus->rbuffer_size - size); @@ -925,11 +929,7 @@ static int bus_socket_make_message(sd_bus *bus, size_t size) { bus->fds = NULL; bus->n_fds = 0; - r = bus_rqueue_push(bus, t); - if (r < 0) { - sd_bus_message_unref(t); - return r; - } + bus->rqueue[bus->rqueue_size++] = t; return 1; } @@ -953,10 +953,6 @@ int bus_socket_read_message(sd_bus *bus) { assert(bus); assert(bus->state == BUS_RUNNING || bus->state == BUS_HELLO); - r = bus_rqueue_make_room(bus, 1); - if (r < 0) - return r; - r = bus_socket_read_message_need(bus, &need); if (r < 0) return r; |