mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-21 06:03:12 +00:00
reset urandomfd if it delivers an EBADF (seeing this on Mesh Extenders)
This commit is contained in:
parent
0898981807
commit
243a26707e
1
os.c
1
os.c
@ -110,6 +110,7 @@ int urandombytes(unsigned char *buf, unsigned long long len)
|
|||||||
if (i == -1) {
|
if (i == -1) {
|
||||||
if (++tries > 4) {
|
if (++tries > 4) {
|
||||||
WHY_perror("read(/dev/urandom)");
|
WHY_perror("read(/dev/urandom)");
|
||||||
|
if (errno==EBADF) urandomfd=-1;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user