summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2013-04-15 05:39:21 +0000
committerdelphij <delphij@FreeBSD.org>2013-04-15 05:39:21 +0000
commitdb5542d7fa522a2b2fb4e545b84e44e32a1cc82d (patch)
tree743187f5b5b600e3cfc19124e26be258bddd1490 /sbin
parentf60aecd8cceb20af13105c4a025a7e923e2c5602 (diff)
downloadFreeBSD-src-db5542d7fa522a2b2fb4e545b84e44e32a1cc82d.zip
FreeBSD-src-db5542d7fa522a2b2fb4e545b84e44e32a1cc82d.tar.gz
Use arc4random() instead of random().
MFC after: 2 weeks
Diffstat (limited to 'sbin')
-rw-r--r--sbin/growfs/growfs.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c
index 745e9e9..fe49efb 100644
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
@@ -141,14 +141,9 @@ growfs(int fsi, int fso, unsigned int Nflag)
uint cylno;
int i, j, width;
char tmpbuf[100];
- static int randinit = 0;
DBG_ENTER;
- if (!randinit) {
- randinit = 1;
- srandomdev();
- }
time(&modtime);
/*
@@ -407,7 +402,7 @@ initcg(int cylno, time_t modtime, int fso, unsigned int Nflag)
i += sblock.fs_frag) {
dp1 = (struct ufs1_dinode *)(void *)iobuf;
for (j = 0; j < INOPB(&sblock); j++) {
- dp1->di_gen = random();
+ dp1->di_gen = arc4random();
dp1++;
}
wtfs(fsbtodb(&sblock, cgimin(&sblock, cylno) + i),
OpenPOWER on IntegriCloud