r->n_ref = REFCNT_INIT;
r->input_fd = r->output_fd = -1;
r->message_version = 1;
- r->hello_flags |= KDBUS_HELLO_ACCEPT_FD;
+ r->hello_flags |= KDBUS_HELLO_ACCEPT_FD|KDBUS_HELLO_ATTACH_NAMES;
r->original_pid = getpid();
assert_se(pthread_mutex_init(&r->memfd_cache_mutex, NULL) == 0);
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);
if (!bus->unique_name)
return -ENOMEM;
- bus->state = BUS_RUNNING;
+ if (bus->state == BUS_HELLO)
+ bus->state = BUS_RUNNING;
return 1;
}