Include missing <time.h>
Add missing RNG initialization Use srandomdev() for RNG initialization
This commit is contained in:
parent
cb78754c12
commit
c59856210e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24216
@ -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 <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
void usage __P((int));
|
void usage __P((int));
|
||||||
@ -85,6 +86,9 @@ main(argc, argv)
|
|||||||
if (argc - optind < 1)
|
if (argc - optind < 1)
|
||||||
usage(1);
|
usage(1);
|
||||||
|
|
||||||
|
if (srandomdev() < 0)
|
||||||
|
srandom(time(NULL) ^ getpid());
|
||||||
|
|
||||||
/* Increase our data size to the max */
|
/* Increase our data size to the max */
|
||||||
if (getrlimit(RLIMIT_DATA, &rl) == 0) {
|
if (getrlimit(RLIMIT_DATA, &rl) == 0) {
|
||||||
rl.rlim_cur = rl.rlim_max;
|
rl.rlim_cur = rl.rlim_max;
|
||||||
|
Loading…
Reference in New Issue
Block a user