1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #4685 from d00616/fix_native_random

pkg/driver: native random fix for micro-ecc
This commit is contained in:
Cenk Gündoğan 2016-01-26 16:23:51 +01:00
commit 52d6444725

View File

@ -137,9 +137,12 @@ void _native_rng_init_hq(void)
{
DEBUG("_native_rng_init_hq\n");
_native_syscall_enter();
dev_random = real_open("/dev/random", O_RDONLY);
dev_random = real_open("/dev/urandom", O_RDONLY | O_CLOEXEC);
if (dev_random == -1) {
err(EXIT_FAILURE, "_native_rng_init_hq: open(/dev/random)");
dev_random = real_open("/dev/random", O_RDONLY | O_CLOEXEC);
if (dev_random == -1) {
err(EXIT_FAILURE, "_native_rng_init_hq: open(/dev/urandom|/dev/random)");
}
}
_native_syscall_leave();
}