Mercurial > dropbear
diff random.c @ 855:04ede40a529a
- Some fixes for old compilers like tru64 v4 from Daniel Richard G.
- Don't warn about blocking random device for prngd
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 14 Nov 2013 21:36:45 +0800 |
parents | 3a9ec98808c3 |
children | c19acba28590 |
line wrap: on
line diff
--- a/random.c Thu Nov 14 20:45:46 2013 +0800 +++ b/random.c Thu Nov 14 21:36:45 2013 +0800 @@ -79,12 +79,15 @@ { 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);