summaryrefslogtreecommitdiffhomepage
path: root/random.c
diff options
context:
space:
mode:
Diffstat (limited to 'random.c')
-rw-r--r--random.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/random.c b/random.c
index bbe84b5..6743654 100644
--- a/random.c
+++ b/random.c
@@ -79,12 +79,15 @@ process_file(hash_state *hs, const char *filename,
{
int readlen, wantread;
unsigned char readbuf[4096];
- if (!already_blocked)
+ if (!already_blocked && !prngd)
{
int res;
- struct timeval timeout = { .tv_sec = 2, .tv_usec = 0};
+ struct timeval timeout;
fd_set read_fds;
+ timeout.tv_sec = 2;
+ timeout.tv_usec = 0;
+
FD_ZERO(&read_fds);
FD_SET(readfd, &read_fds);
res = select(readfd + 1, &read_fds, NULL, NULL, &timeout);