diff --git a/src/pipewire/impl-core.c b/src/pipewire/impl-core.c index 72bfb176e..1efc8b1ea 100644 --- a/src/pipewire/impl-core.c +++ b/src/pipewire/impl-core.c @@ -405,7 +405,15 @@ struct pw_impl_core *pw_context_create_core(struct pw_context *context, this->info.user_name = pw_get_user_name(); this->info.host_name = pw_get_host_name(); this->info.version = pw_get_library_version(); - getrandom(&this->info.cookie, sizeof(this->info.cookie), 0); + while (getrandom(&this->info.cookie, sizeof(this->info.cookie), 0) != + sizeof(this->info.cookie)) { + if (errno == EINTR) + continue; + pw_log_warn(NAME" %p: cookie getrandom failed: %m", this); + this->info.cookie = rand(); + break; + } + this->info.name = name; spa_hook_list_init(&this->listener_list);