srandomdev: use stack junk value in the fallback code too

This commit is contained in:
Andrey A. Chernov 1997-06-15 18:23:19 +00:00
parent 6b195d32a1
commit f2305d469b
1 changed files with 3 additions and 2 deletions

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: random.c,v 1.8 1997/03/29 19:55:03 ache Exp $
* $Id: random.c,v 1.9 1997/06/14 00:13:56 ache Exp $
*
*/
@ -307,9 +307,10 @@ srandomdev()
if (!done) {
struct timeval tv;
unsigned long junk;
gettimeofday(&tv, NULL);
srandom(getpid() ^ tv.tv_sec ^ tv.tv_usec);
srandom(getpid() ^ tv.tv_sec ^ tv.tv_usec ^ junk);
return;
}