summaryrefslogtreecommitdiffstats
path: root/sbin/growfs
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-01-17 22:19:35 +0000
committered <ed@FreeBSD.org>2012-01-17 22:19:35 +0000
commit71166c4906541efdac8902b4d8386a89f51a31fc (patch)
tree2bdf500aab92823761affadf7f79d5707e87682e /sbin/growfs
parenta5c88f4732cc58341150fbb685858567a8fa7489 (diff)
downloadFreeBSD-src-71166c4906541efdac8902b4d8386a89f51a31fc.zip
FreeBSD-src-71166c4906541efdac8902b4d8386a89f51a31fc.tar.gz
Allow growfs to be built with GCC 4.7 and -Werror.
The dp1 variable is only used when FSIRAND is defined. Just place the variable behind #ifdefs entirely.
Diffstat (limited to 'sbin/growfs')
-rw-r--r--sbin/growfs/growfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c
index 18b4a05..3e9ba1a 100644
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
@@ -374,7 +374,9 @@ initcg(int cylno, time_t modtime, int fso, unsigned int Nflag)
static caddr_t iobuf;
long blkno, start;
ufs2_daddr_t i, cbase, dmax;
+#ifdef FSIRAND
struct ufs1_dinode *dp1;
+#endif
struct csum *cs;
uint d, dupper, dlower;
@@ -452,8 +454,8 @@ initcg(int cylno, time_t modtime, int fso, unsigned int Nflag)
bzero(iobuf, sblock.fs_bsize);
for (i = 0; i < sblock.fs_ipg / INOPF(&sblock);
i += sblock.fs_frag) {
- dp1 = (struct ufs1_dinode *)(void *)iobuf;
#ifdef FSIRAND
+ dp1 = (struct ufs1_dinode *)(void *)iobuf;
for (j = 0; j < INOPB(&sblock); j++) {
dp1->di_gen = random();
dp1++;
OpenPOWER on IntegriCloud