Add a -q (quiet) option to print nothing for clean filesystems.

Support in fsck_ffs and stub in fsck_xxx.
Push a few more messages through pwarn() instead of printf() to ensure
disk name is shown.
This commit is contained in:
dsl 2003-10-20 12:04:38 +00:00
parent 60e31ba365
commit e69ce3e4bf
11 changed files with 102 additions and 75 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: fsck.8,v 1.28 2003/02/25 10:34:55 wiz Exp $ .\" $NetBSD: fsck.8,v 1.29 2003/10/20 12:04:38 dsl Exp $
.\" .\"
.\" Copyright (c) 1996 Christos Zoulas. All rights reserved. .\" Copyright (c) 1996 Christos Zoulas. All rights reserved.
.\" .\"
@ -27,7 +27,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.Dd June 18, 2001 .Dd October 20, 2003
.Dt FSCK 8 .Dt FSCK 8
.Os .Os
.Sh NAME .Sh NAME
@ -35,7 +35,7 @@
.Nd file system consistency check and interactive repair .Nd file system consistency check and interactive repair
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl dfnpvy .Op Fl dfnpqvy
.Op Fl l Ar maxparallel .Op Fl l Ar maxparallel
.Op Fl t Ar fstype .Op Fl t Ar fstype
.Op Fl T Ar fstype:fsoptions .Op Fl T Ar fstype:fsoptions
@ -101,6 +101,8 @@ to exit with a non-zero
.Xr exit 3 .Xr exit 3
code, so as to alert any invoking program or script that human code, so as to alert any invoking program or script that human
intervention is required. intervention is required.
.It Fl q
Quiet mode, do not output any messages for clean filesystems.
.It Fl t Ar fstype .It Fl t Ar fstype
Invoke Invoke
.Nm .Nm

View File

@ -1,4 +1,4 @@
/* $NetBSD: fsck.c,v 1.30 2003/08/07 10:04:15 agc Exp $ */ /* $NetBSD: fsck.c,v 1.31 2003/10/20 12:04:38 dsl Exp $ */
/* /*
* Copyright (c) 1980, 1989, 1993, 1994 * Copyright (c) 1980, 1989, 1993, 1994
@ -71,7 +71,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: fsck.c,v 1.30 2003/08/07 10:04:15 agc Exp $"); __RCSID("$NetBSD: fsck.c,v 1.31 2003/10/20 12:04:38 dsl Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -139,37 +139,34 @@ main(int argc, char *argv[])
TAILQ_INIT(&selhead); TAILQ_INIT(&selhead);
TAILQ_INIT(&opthead); TAILQ_INIT(&opthead);
while ((i = getopt(argc, argv, "dvpfnyl:t:T:")) != -1) while ((i = getopt(argc, argv, "dfl:npqT:t:vy")) != -1) {
switch (i) { switch (i) {
case 'd': case 'd':
flags |= CHECK_DEBUG; flags |= CHECK_DEBUG;
continue;
case 'f':
flags |= CHECK_FORCE;
break; break;
case 'v': case 'n':
flags |= CHECK_VERBOSE;
break; break;
case 'p': case 'p':
case 'f': flags |= CHECK_PREEN;
if (i == 'p') break;
flags |= CHECK_PREEN;
else case 'q':
flags |= CHECK_FORCE;
/*FALLTHROUGH*/
case 'n':
case 'y':
globopt[1] = i;
catopt(&options, globopt);
break; break;
case 'l': case 'l':
maxrun = atoi(optarg); maxrun = atoi(optarg);
break; continue;
case 'T': case 'T':
if (*optarg) if (*optarg)
addoption(optarg); addoption(optarg);
break; continue;
case 't': case 't':
if (TAILQ_FIRST(&selhead) != NULL) if (TAILQ_FIRST(&selhead) != NULL)
@ -177,6 +174,13 @@ main(int argc, char *argv[])
maketypelist(optarg); maketypelist(optarg);
vfstype = optarg; vfstype = optarg;
continue;
case 'v':
flags |= CHECK_VERBOSE;
continue;
case 'y':
break; break;
case '?': case '?':
@ -185,6 +189,11 @@ main(int argc, char *argv[])
/* NOTREACHED */ /* NOTREACHED */
} }
/* Pass option to fsck_xxxfs */
globopt[1] = i;
catopt(&options, globopt);
}
argc -= optind; argc -= optind;
argv += optind; argv += optind;
@ -556,7 +565,7 @@ static void
usage(void) usage(void)
{ {
static const char common[] = static const char common[] =
"[-dfnpvy] [-T fstype:fsoptions] [-t fstype]"; "[-dfnpqvy] [-T fstype:fsoptions] [-t fstype]";
(void)fprintf(stderr, "Usage: %s %s [special|node]...\n", (void)fprintf(stderr, "Usage: %s %s [special|node]...\n",
getprogname(), common); getprogname(), common);

View File

@ -1,4 +1,4 @@
/* $NetBSD: fsutil.c,v 1.13 2003/08/07 10:04:16 agc Exp $ */ /* $NetBSD: fsutil.c,v 1.14 2003/10/20 12:04:38 dsl Exp $ */
/* /*
* Copyright (c) 1990, 1993 * Copyright (c) 1990, 1993
@ -31,7 +31,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: fsutil.c,v 1.13 2003/08/07 10:04:16 agc Exp $"); __RCSID("$NetBSD: fsutil.c,v 1.14 2003/10/20 12:04:38 dsl Exp $");
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -52,6 +52,7 @@ __RCSID("$NetBSD: fsutil.c,v 1.13 2003/08/07 10:04:16 agc Exp $");
static const char *dev = NULL; static const char *dev = NULL;
static int hot = 0; static int hot = 0;
static int preen = 0; static int preen = 0;
int quiet;
void void
setcdevname(const char *cd, int pr) setcdevname(const char *cd, int pr)
@ -92,7 +93,11 @@ vmsg(int fatal, const char *fmt, va_list ap)
{ {
if (!fatal && preen) if (!fatal && preen)
(void) printf("%s: ", dev); (void)printf("%s: ", dev);
if (quiet && !preen) {
(void)printf("** %s (vmsg)\n", dev);
quiet = 0;
}
(void) vprintf(fmt, ap); (void) vprintf(fmt, ap);

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.13 2003/10/05 17:48:49 bouyer Exp $ */ /* $NetBSD: main.c,v 1.14 2003/10/20 12:04:38 dsl Exp $ */
/* /*
* Copyright (c) 1980, 1986, 1993 * Copyright (c) 1980, 1986, 1993
@ -69,7 +69,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1993\n\
#if 0 #if 0
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/23/94"; static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 1/23/94";
#else #else
__RCSID("$NetBSD: main.c,v 1.13 2003/10/05 17:48:49 bouyer Exp $"); __RCSID("$NetBSD: main.c,v 1.14 2003/10/20 12:04:38 dsl Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -109,7 +109,7 @@ main(argc, argv)
sync(); sync();
skipclean = 1; skipclean = 1;
while ((ch = getopt(argc, argv, "b:c:dfm:npy")) != -1) { while ((ch = getopt(argc, argv, "b:c:dfm:npqy")) != -1) {
switch (ch) { switch (ch) {
case 'b': case 'b':
skipclean = 0; skipclean = 0;
@ -141,6 +141,9 @@ main(argc, argv)
preen++; preen++;
break; break;
case 'q': /* Quiet not implemented */
break;
case 'y': case 'y':
yflag++; yflag++;
nflag = 0; nflag = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: fsck.h,v 1.35 2003/08/07 10:04:19 agc Exp $ */ /* $NetBSD: fsck.h,v 1.36 2003/10/20 12:04:38 dsl Exp $ */
/* /*
* Copyright (c) 1980, 1986, 1993 * Copyright (c) 1980, 1986, 1993
@ -240,6 +240,7 @@ int doinglevel2; /* converting to new inode format */
int newinofmt; /* filesystem has new inode format */ int newinofmt; /* filesystem has new inode format */
char usedsoftdep; /* just fix soft dependency inconsistencies */ char usedsoftdep; /* just fix soft dependency inconsistencies */
int preen; /* just fix normal inconsistencies */ int preen; /* just fix normal inconsistencies */
int quiet; /* Don't print anything if clean */
int forceimage; /* file system is an image file */ int forceimage; /* file system is an image file */
int doswap; /* convert byte order */ int doswap; /* convert byte order */
int needswap; /* need to convert byte order in memory */ int needswap; /* need to convert byte order in memory */
@ -255,7 +256,7 @@ int fsreadfd; /* file descriptor for reading file system */
int fswritefd; /* file descriptor for writing file system */ int fswritefd; /* file descriptor for writing file system */
int rerun; /* rerun fsck. Only used in non-preen mode */ int rerun; /* rerun fsck. Only used in non-preen mode */
char resolved; /* cleared if unresolved changes => not clean */ char resolved; /* cleared if unresolved changes => not clean */
int isappleufs; /* filesystem is Apple UFS */ int isappleufs; /* filesystem is Apple UFS */
daddr_t maxfsblock; /* number of blocks in the file system */ daddr_t maxfsblock; /* number of blocks in the file system */
char *blockmap; /* ptr to primary blk allocation map */ char *blockmap; /* ptr to primary blk allocation map */

View File

@ -1,4 +1,4 @@
.\" $NetBSD: fsck_ffs.8,v 1.33 2003/08/07 10:04:20 agc Exp $ .\" $NetBSD: fsck_ffs.8,v 1.34 2003/10/20 12:04:38 dsl Exp $
.\" .\"
.\" Copyright (c) 1980, 1989, 1991, 1993 .\" Copyright (c) 1980, 1989, 1991, 1993
.\" The Regents of the University of California. All rights reserved. .\" The Regents of the University of California. All rights reserved.
@ -29,7 +29,7 @@
.\" .\"
.\" @(#)fsck.8 8.3 (Berkeley) 11/29/94 .\" @(#)fsck.8 8.3 (Berkeley) 11/29/94
.\" .\"
.Dd May 6, 2001 .Dd October 20, 2003
.Dt FSCK_FFS 8 .Dt FSCK_FFS 8
.Os .Os
.Sh NAME .Sh NAME
@ -37,17 +37,12 @@
.Nd Fast File System consistency check and interactive repair .Nd Fast File System consistency check and interactive repair
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl a .Op Fl adFfpq
.Op Fl B Ar byte order .Op Fl B Ar byte order
.Op Fl b Ar block# .Op Fl b Ar block#
.Op Fl c Ar level .Op Fl c Ar level
.Op Fl d
.Op Fl F
.Op Fl f
.Op Fl m Ar mode .Op Fl m Ar mode
.Op Fl p .Op Fl y | n
.Op Fl y
.Op Fl n
.Ar filesystem ... .Ar filesystem ...
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm .Nm
@ -230,6 +225,8 @@ which is assumed to be affirmative;
do not open the file system for writing. do not open the file system for writing.
.It Fl p .It Fl p
Specify ``preen'' mode, described above. Specify ``preen'' mode, described above.
.It Fl q
Quiet mode, do not output any messages for clean filesystems.
.It Fl y .It Fl y
Assume a yes response to all questions asked by Assume a yes response to all questions asked by
.Nm ; .Nm ;

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.46 2003/08/07 10:04:20 agc Exp $ */ /* $NetBSD: main.c,v 1.47 2003/10/20 12:04:38 dsl Exp $ */
/* /*
* Copyright (c) 1980, 1986, 1993 * Copyright (c) 1980, 1986, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1993\n\
#if 0 #if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95"; static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14/95";
#else #else
__RCSID("$NetBSD: main.c,v 1.46 2003/08/07 10:04:20 agc Exp $"); __RCSID("$NetBSD: main.c,v 1.47 2003/10/20 12:04:38 dsl Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -94,7 +94,7 @@ main(argc, argv)
forceimage = 0; forceimage = 0;
endian = 0; endian = 0;
isappleufs = 0; isappleufs = 0;
while ((ch = getopt(argc, argv, "aB:b:c:dFfm:npy")) != -1) { while ((ch = getopt(argc, argv, "aB:b:c:dFfm:npqy")) != -1) {
switch (ch) { switch (ch) {
case 'a': case 'a':
isappleufs = 1; isappleufs = 1;
@ -147,6 +147,10 @@ main(argc, argv)
preen++; preen++;
break; break;
case 'q':
quiet++;
break;
case 'y': case 'y':
yflag++; yflag++;
nflag = 0; nflag = 0;
@ -241,10 +245,10 @@ checkfilesys(filesys, mntpt, auxdata, child)
* 1: scan inodes tallying blocks used * 1: scan inodes tallying blocks used
*/ */
if (preen == 0) { if (preen == 0) {
printf("** Last Mounted on %s\n", sblock->fs_fsmnt); pwarn("** Last Mounted on %s\n", sblock->fs_fsmnt);
if (hotroot()) if (hotroot())
printf("** Root file system\n"); pwarn("** Root file system\n");
printf("** Phase 1 - Check Blocks and Sizes\n"); pwarn("** Phase 1 - Check Blocks and Sizes\n");
} }
pass1(); pass1();
@ -256,7 +260,7 @@ checkfilesys(filesys, mntpt, auxdata, child)
pfatal("INTERNAL ERROR: dups with -p\n"); pfatal("INTERNAL ERROR: dups with -p\n");
if (usedsoftdep) if (usedsoftdep)
pfatal("INTERNAL ERROR: dups with softdep\n"); pfatal("INTERNAL ERROR: dups with softdep\n");
printf("** Phase 1b - Rescan For More DUPS\n"); pwarn("** Phase 1b - Rescan For More DUPS\n");
pass1b(); pass1b();
} }
@ -264,28 +268,28 @@ checkfilesys(filesys, mntpt, auxdata, child)
* 2: traverse directories from root to mark all connected directories * 2: traverse directories from root to mark all connected directories
*/ */
if (preen == 0) if (preen == 0)
printf("** Phase 2 - Check Pathnames\n"); pwarn("** Phase 2 - Check Pathnames\n");
pass2(); pass2();
/* /*
* 3: scan inodes looking for disconnected directories * 3: scan inodes looking for disconnected directories
*/ */
if (preen == 0) if (preen == 0)
printf("** Phase 3 - Check Connectivity\n"); pwarn("** Phase 3 - Check Connectivity\n");
pass3(); pass3();
/* /*
* 4: scan inodes looking for disconnected files; check reference counts * 4: scan inodes looking for disconnected files; check reference counts
*/ */
if (preen == 0) if (preen == 0)
printf("** Phase 4 - Check Reference Counts\n"); pwarn("** Phase 4 - Check Reference Counts\n");
pass4(); pass4();
/* /*
* 5: check and repair resource counts in cylinder groups * 5: check and repair resource counts in cylinder groups
*/ */
if (preen == 0) if (preen == 0)
printf("** Phase 5 - Check Cyl groups\n"); pwarn("** Phase 5 - Check Cyl groups\n");
pass5(); pass5();
/* /*
@ -362,9 +366,9 @@ checkfilesys(filesys, mntpt, auxdata, child)
if (!fsmodified) if (!fsmodified)
return (0); return (0);
if (!preen) if (!preen)
printf("\n***** FILE SYSTEM WAS MODIFIED *****\n"); pwarn("\n***** FILE SYSTEM WAS MODIFIED *****\n");
if (rerun) if (rerun)
printf("\n***** PLEASE RERUN FSCK *****\n"); pwarn("\n***** PLEASE RERUN FSCK *****\n");
if (hotroot()) { if (hotroot()) {
struct statfs stfs_buf; struct statfs stfs_buf;
/* /*
@ -387,7 +391,7 @@ checkfilesys(filesys, mntpt, auxdata, child)
} }
} }
if (!preen) if (!preen)
printf("\n***** REBOOT NOW *****\n"); pwarn("\n***** REBOOT NOW *****\n");
sync(); sync();
return (4); return (4);
} }
@ -399,7 +403,7 @@ usage()
{ {
(void) fprintf(stderr, (void) fprintf(stderr,
"Usage: %s [-dFfnpy] [-B be|le] [-b block] [-c level] [-m mode]" "Usage: %s [-dFfnpqy] [-B be|le] [-b block] [-c level] [-m mode]"
" filesystem ...\n", " filesystem ...\n",
getprogname()); getprogname());
exit(1); exit(1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: setup.c,v 1.62 2003/08/07 10:04:21 agc Exp $ */ /* $NetBSD: setup.c,v 1.63 2003/10/20 12:04:38 dsl Exp $ */
/* /*
* Copyright (c) 1980, 1986, 1993 * Copyright (c) 1980, 1986, 1993
@ -34,7 +34,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)setup.c 8.10 (Berkeley) 5/9/95"; static char sccsid[] = "@(#)setup.c 8.10 (Berkeley) 5/9/95";
#else #else
__RCSID("$NetBSD: setup.c,v 1.62 2003/08/07 10:04:21 agc Exp $"); __RCSID("$NetBSD: setup.c,v 1.63 2003/10/20 12:04:38 dsl Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -107,16 +107,15 @@ setup(dev)
printf("Can't open %s: %s\n", dev, strerror(errno)); printf("Can't open %s: %s\n", dev, strerror(errno));
return (0); return (0);
} }
if (preen == 0)
printf("** %s", dev);
if (nflag || (fswritefd = open(dev, O_WRONLY)) < 0) { if (nflag || (fswritefd = open(dev, O_WRONLY)) < 0) {
fswritefd = -1; fswritefd = -1;
if (preen) if (preen)
pfatal("NO WRITE ACCESS"); pfatal("NO WRITE ACCESS");
printf(" (NO WRITE)"); printf("** %s (NO WRITE)\n", dev);
} quiet = 0;
if (preen == 0) } else
printf("\n"); if (!preen && !quiet)
printf("** %s\n", dev);
fsmodified = 0; fsmodified = 0;
lfdir = 0; lfdir = 0;
initbarea(&sblk); initbarea(&sblk);
@ -170,8 +169,9 @@ setup(dev)
} }
if (sblock->fs_clean & FS_ISCLEAN) { if (sblock->fs_clean & FS_ISCLEAN) {
if (doskipclean) { if (doskipclean) {
pwarn("%sile system is clean; not checking\n", if (!quiet)
preen ? "f" : "** F"); pwarn("%sile system is clean; not checking\n",
preen ? "f" : "** F");
return (-1); return (-1);
} }
if (!preen && !doswap) if (!preen && !doswap)
@ -381,14 +381,14 @@ setup(dev)
bmapsize = roundup(howmany(maxfsblock, NBBY), sizeof(int16_t)); bmapsize = roundup(howmany(maxfsblock, NBBY), sizeof(int16_t));
blockmap = calloc((unsigned)bmapsize, sizeof (char)); blockmap = calloc((unsigned)bmapsize, sizeof (char));
if (blockmap == NULL) { if (blockmap == NULL) {
printf("cannot alloc %u bytes for blockmap\n", pwarn("cannot alloc %u bytes for blockmap\n",
(unsigned)bmapsize); (unsigned)bmapsize);
goto badsblabel; goto badsblabel;
} }
inostathead = calloc((unsigned)(sblock->fs_ncg), inostathead = calloc((unsigned)(sblock->fs_ncg),
sizeof(struct inostatlist)); sizeof(struct inostatlist));
if (inostathead == NULL) { if (inostathead == NULL) {
printf("cannot alloc %u bytes for inostathead\n", pwarn("cannot alloc %u bytes for inostathead\n",
(unsigned)(sizeof(struct inostatlist) * (sblock->fs_ncg))); (unsigned)(sizeof(struct inostatlist) * (sblock->fs_ncg)));
goto badsblabel; goto badsblabel;
} }
@ -411,13 +411,13 @@ setup(dev)
inphead = (struct inoinfo **)calloc((unsigned)numdirs, inphead = (struct inoinfo **)calloc((unsigned)numdirs,
sizeof(struct inoinfo *)); sizeof(struct inoinfo *));
if (inpsort == NULL || inphead == NULL) { if (inpsort == NULL || inphead == NULL) {
printf("cannot alloc %u bytes for inphead\n", pwarn("cannot alloc %u bytes for inphead\n",
(unsigned)(numdirs * sizeof(struct inoinfo *))); (unsigned)(numdirs * sizeof(struct inoinfo *)));
goto badsblabel; goto badsblabel;
} }
cgrp = malloc(sblock->fs_cgsize); cgrp = malloc(sblock->fs_cgsize);
if (cgrp == NULL) { if (cgrp == NULL) {
printf("cannot alloc %u bytes for cylinder group\n", pwarn("cannot alloc %u bytes for cylinder group\n",
sblock->fs_cgsize); sblock->fs_cgsize);
goto badsblabel; goto badsblabel;
} }
@ -641,7 +641,7 @@ readsb(listerr)
pfatal("INTERNAL ERROR: unknown endian"); pfatal("INTERNAL ERROR: unknown endian");
} }
if (needswap) if (needswap)
printf("** Swapped byte order\n"); pwarn("** Swapped byte order\n");
/* swap SB byte order if asked */ /* swap SB byte order if asked */
if (doswap) if (doswap)
ffs_sb_swap(sblk.b_un.b_fs, sblk.b_un.b_fs); ffs_sb_swap(sblk.b_un.b_fs, sblk.b_un.b_fs);

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.15 2003/08/07 10:04:23 agc Exp $ */ /* $NetBSD: main.c,v 1.16 2003/10/20 12:04:38 dsl Exp $ */
/* /*
* Copyright (c) 1980, 1986, 1993 * Copyright (c) 1980, 1986, 1993
@ -64,7 +64,7 @@ main(int argc, char **argv)
{ {
int ch; int ch;
int ret = 0; int ret = 0;
char *optstring = "b:dfi:m:npy"; char *optstring = "b:dfi:m:npqy";
sync(); sync();
skipclean = 1; skipclean = 1;
@ -106,6 +106,9 @@ main(int argc, char **argv)
preen++; preen++;
break; break;
case 'q': /* Quiet not implemented */
break;
case 'y': case 'y':
yflag++; yflag++;
nflag = 0; nflag = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: utilities.c,v 1.15 2003/08/07 10:04:24 agc Exp $ */ /* $NetBSD: utilities.c,v 1.16 2003/10/20 12:04:38 dsl Exp $ */
/* /*
* Copyright (c) 1980, 1986, 1993 * Copyright (c) 1980, 1986, 1993
@ -92,7 +92,7 @@ reply(char *question)
if (preen) if (preen)
err(1, "INTERNAL ERROR: GOT TO reply()"); err(1, "INTERNAL ERROR: GOT TO reply()");
persevere = !strcmp(question, "CONTINUE"); persevere = !strcmp(question, "CONTINUE");
printf("\n"); pwarn("\n");
if (!persevere && nflag) { if (!persevere && nflag) {
printf("%s? no\n\n", question); printf("%s? no\n\n", question);
return (0); return (0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.13 2002/05/25 23:45:13 wiz Exp $ */ /* $NetBSD: main.c,v 1.14 2003/10/20 12:04:38 dsl Exp $ */
/* /*
* Copyright (C) 1995 Wolfgang Solfrank * Copyright (C) 1995 Wolfgang Solfrank
@ -35,7 +35,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: main.c,v 1.13 2002/05/25 23:45:13 wiz Exp $"); __RCSID("$NetBSD: main.c,v 1.14 2003/10/20 12:04:38 dsl Exp $");
#endif /* not lint */ #endif /* not lint */
#include <stdlib.h> #include <stdlib.h>
@ -71,7 +71,7 @@ main(argc, argv)
int ret = 0, erg; int ret = 0, erg;
int ch; int ch;
while ((ch = getopt(argc, argv, "pynf")) != -1) { while ((ch = getopt(argc, argv, "pqynf")) != -1) {
switch (ch) { switch (ch) {
case 'f': case 'f':
/* /*
@ -93,6 +93,9 @@ main(argc, argv)
alwaysyes = alwaysno = 0; alwaysyes = alwaysno = 0;
break; break;
case 'q': /* quite not implemented */
break;
default: default:
usage(); usage();
break; break;