xiaoxiang781216 commented on a change in pull request #5837: URL: https://github.com/apache/incubator-nuttx/pull/5837#discussion_r835026236
########## File path: libs/libc/uuid/lib_uuid_create.c ########## @@ -42,17 +43,24 @@ void uuid_create(uuid_t *u, uint32_t *status) { -#ifdef CONFIG_CRYPTO_RANDOM_POOL - arc4random_buf(u, sizeof(uuid_t)); -#else - unsigned long *beg = (unsigned long *)u; - unsigned long *end = (unsigned long *)(u + 1); + ssize_t ret; - while (beg < end) + ret = getrandom(u, sizeof(uuid_t), 0); + if (ret < 0) { - *beg++ = rand(); + ret = getrandom(u, sizeof(uuid_t), GRND_RANDOM); Review comment: Done. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org