summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libsystemd-bus/sd-bus.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index 1207d5ad2e..f13e346dcf 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -380,7 +380,7 @@ static int hello_callback(sd_bus *bus, sd_bus_message *reply, void *userdata, sd
int r;
assert(bus);
- assert(bus->state == BUS_HELLO);
+ assert(bus->state == BUS_HELLO || bus->state == BUS_CLOSING);
assert(reply);
r = sd_bus_message_get_errno(reply);
@@ -400,7 +400,8 @@ static int hello_callback(sd_bus *bus, sd_bus_message *reply, void *userdata, sd
if (!bus->unique_name)
return -ENOMEM;
- bus->state = BUS_RUNNING;
+ if (bus->state == BUS_HELLO)
+ bus->state = BUS_RUNNING;
return 1;
}