diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-10-06 20:23:17 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-10-06 20:23:17 +0000 |
commit | 85674180ac0b414993bec634994ea51b28390306 (patch) | |
tree | 5ce384dfed739e368b8605fc6db4ed1f26a43609 /sbin/fsck_ffs/utilities.c | |
parent | 44f83f3e77b70fbce9f014e39cf5c97bae700213 (diff) |
back out vfs lite2 till after 2.2
Diffstat (limited to 'sbin/fsck_ffs/utilities.c')
-rw-r--r-- | sbin/fsck_ffs/utilities.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/sbin/fsck_ffs/utilities.c b/sbin/fsck_ffs/utilities.c index 3b6dfe2d017..643ac2a1c65 100644 --- a/sbin/fsck_ffs/utilities.c +++ b/sbin/fsck_ffs/utilities.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utilities.c,v 1.5 1997/10/06 15:33:36 csapuntz Exp $ */ +/* $OpenBSD: utilities.c,v 1.6 1997/10/06 20:22:37 deraadt Exp $ */ /* $NetBSD: utilities.c,v 1.18 1996/09/27 22:45:20 christos Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)utilities.c 8.1 (Berkeley) 6/5/93"; #else -static char rcsid[] = "$OpenBSD: utilities.c,v 1.5 1997/10/06 15:33:36 csapuntz Exp $"; +static char rcsid[] = "$OpenBSD: utilities.c,v 1.6 1997/10/06 20:22:37 deraadt Exp $"; #endif #endif /* not lint */ @@ -96,7 +96,6 @@ reply(question) printf("\n"); if (!persevere && (nflag || fswritefd < 0)) { printf("%s? no\n\n", question); - resolved = 0; return (0); } if (yflag || (persevere && nflag)) { @@ -107,17 +106,13 @@ reply(question) printf("%s? [yn] ", question); (void) fflush(stdout); c = getc(stdin); - while (c != '\n' && getc(stdin) != '\n') { - if (feof(stdin)) { - resolved = 0; + while (c != '\n' && getc(stdin) != '\n') + if (feof(stdin)) return (0); - } - } } while (c != 'y' && c != 'Y' && c != 'n' && c != 'N'); printf("\n"); if (c == 'y' || c == 'Y') return (1); - resolved = 0; return (0); } @@ -379,8 +374,7 @@ int allocblk(frags) long frags; { - int i, j, k, cg, baseblk; - struct cg *cgp = &cgrp; + register int i, j, k; if (frags <= 0 || frags > sblock.fs_frag) return (0); @@ -395,21 +389,9 @@ allocblk(frags) j += k; continue; } - cg = dtog(&sblock, i + j); - getblk(&cgblk, cgtod(&sblock, cg), sblock.fs_cgsize); - if (!cg_chkmagic(cgp)) - pfatal("CG %d: BAD MAGIC NUMBER\n", cg); - baseblk = dtogd(&sblock, i + j); - - for (k = 0; k < frags; k++) { + for (k = 0; k < frags; k++) setbmap(i + j + k); - clrbit(cg_blksfree(cgp), baseblk + k); - } n_blks += frags; - if (frags == sblock.fs_frag) - cgp->cg_cs.cs_nbfree--; - else - cgp->cg_cs.cs_nffree -= frags; return (i + j); } } |