Include missing <time.h>

Add missing RNG initialization
Use srandomdev() for RNG initialization
This commit is contained in:
Andrey A. Chernov 1997-03-24 15:51:11 +00:00
parent cb78754c12
commit c59856210e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24216

View File

@ -50,6 +50,7 @@ static char rcsid[] = "$OpenBSD: fsirand.c,v 1.9 1997/02/28 00:46:33 millert Exp
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
void usage __P((int));
@ -85,6 +86,9 @@ main(argc, argv)
if (argc - optind < 1)
usage(1);
if (srandomdev() < 0)
srandom(time(NULL) ^ getpid());
/* Increase our data size to the max */
if (getrlimit(RLIMIT_DATA, &rl) == 0) {
rl.rlim_cur = rl.rlim_max;