diff options
author | ache <ache@FreeBSD.org> | 1997-03-24 15:51:11 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-03-24 15:51:11 +0000 |
commit | cf3de83d9118c7a9c85d9153b1849bec9c1c7be3 (patch) | |
tree | cb3fa2c2064a2267a55b17513572f386b5891597 /sbin/fsirand | |
parent | 3d7efd90ca448cfb54020ccdcaa7758073d21089 (diff) | |
download | FreeBSD-src-cf3de83d9118c7a9c85d9153b1849bec9c1c7be3.zip FreeBSD-src-cf3de83d9118c7a9c85d9153b1849bec9c1c7be3.tar.gz |
Include missing <time.h>
Add missing RNG initialization
Use srandomdev() for RNG initialization
Diffstat (limited to 'sbin/fsirand')
-rw-r--r-- | sbin/fsirand/fsirand.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sbin/fsirand/fsirand.c b/sbin/fsirand/fsirand.c index 4875ef5..640dd17 100644 --- a/sbin/fsirand/fsirand.c +++ b/sbin/fsirand/fsirand.c @@ -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; |