bus: properly handle if we get disconnected during HELLO phase

This commit is contained in:
Lennart Poettering
2013-11-27 20:28:48 +01:00
parent 613b411c94
commit c99c09a2dc
+3 -2
View File
@@ -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;
}