Changeset View
Changeset View
Standalone View
Standalone View
b/random/rndlinux.c
Context not available. | |||||
struct timeval tv; | struct timeval tv; | ||||
int rc; | int rc; | ||||
if (!any_need_entropy || last_so_far != (want - length) ) | |||||
{ | |||||
last_so_far = want - length; | |||||
_gcry_random_progress ("need_entropy", 'X', | |||||
(int)last_so_far, (int)want); | |||||
any_need_entropy = 1; | |||||
} | |||||
/* If the system has no limit on the number of file descriptors | /* If the system has no limit on the number of file descriptors | ||||
and we encounter an fd which is larger than the fd_set size, | and we encounter an fd which is larger than the fd_set size, | ||||
we don't use the select at all. The select code is only used | we don't use the select at all. The select code is only used | ||||
Context not available. | |||||
tv.tv_usec = delay? 0 : 100000; | tv.tv_usec = delay? 0 : 100000; | ||||
if ( !(rc=select(fd+1, &rfds, NULL, NULL, &tv)) ) | if ( !(rc=select(fd+1, &rfds, NULL, NULL, &tv)) ) | ||||
{ | { | ||||
if (!any_need_entropy || last_so_far != (want - length) ) | |||||
{ | |||||
last_so_far = want - length; | |||||
_gcry_random_progress ("need_entropy", 'X', | |||||
(int)last_so_far, (int)want); | |||||
any_need_entropy = 1; | |||||
} | |||||
delay = 3; /* Use 3 seconds henceforth. */ | delay = 3; /* Use 3 seconds henceforth. */ | ||||
continue; | continue; | ||||
} | } | ||||
Context not available. |