lib_uuid_create: try use hardware random number generators first

Try the hardware random number generators is better for uuid generator

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
Bowen Wang 2024-09-13 15:10:48 +08:00 committed by Xiang Xiao
parent 8d09eaaee0
commit 821196eb22

View file

@ -76,10 +76,10 @@ void uuid_create(FAR uuid_t *u, FAR uint32_t *status)
{
int ret;
ret = uuid_getrandom(u, sizeof(uuid_t), 0);
ret = uuid_getrandom(u, sizeof(uuid_t), GRND_RANDOM);
if (ret < 0)
{
ret = uuid_getrandom(u, sizeof(uuid_t), GRND_RANDOM);
ret = uuid_getrandom(u, sizeof(uuid_t), 0);
}
if (ret < 0)