Skip to content

Commit

Permalink
Fix not working when random device is denied by selinux
Browse files Browse the repository at this point in the history
  • Loading branch information
madafoo committed Oct 27, 2017
1 parent 186169f commit 0c29e9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crypto/random/seed/DevUrandomRandomSeed.c
Expand Up @@ -31,7 +31,7 @@ static int get(struct RandomSeed* randomSeed, uint64_t output[8])
int fd = -1;
int tries = 0;
while ((fd = open("/dev/urandom", O_RDONLY, 0)) < 0) {
if (++tries > MAX_TRIES || errno == ENOENT) {
if (++tries > MAX_TRIES || errno != EINTR) {
return -1;
}
sleep(1);
Expand Down
2 changes: 1 addition & 1 deletion crypto/random/seed/ProcSysKernelRandomUuidRandomSeed.c
Expand Up @@ -33,7 +33,7 @@ static int getUUID(uint64_t output[2])
int fd = -1;
int tries = 0;
while ((fd = open("/proc/sys/kernel/random/uuid", O_RDONLY, 0)) < 0) {
if (++tries > MAX_TRIES || errno == ENOENT) {
if (++tries > MAX_TRIES || errno != EINTR) {
return -1;
}
sleep(1);
Expand Down

0 comments on commit 0c29e9a

Please sign in to comment.