will be calling these directly, and not for the multiple filesystem case.
fsck(8) is generally the parent and will handle things.
ok semarie; this change will also help a goal jsing has
-.\" $OpenBSD: fsck_ext2fs.8,v 1.17 2015/07/27 18:46:19 jmc Exp $
+.\" $OpenBSD: fsck_ext2fs.8,v 1.18 2015/10/14 14:33:45 deraadt Exp $
.\" $NetBSD: fsck_ext2fs.8,v 1.1 1997/06/11 11:21:48 bouyer Exp $
.\"
.\" Copyright (c) 1997 Manuel Bouyer.
.\"
.\" @(#)fsck.8 8.3 (Berkeley) 11/29/94
.\"
-.Dd $Mdocdate: July 27 2015 $
+.Dd $Mdocdate: October 14 2015 $
.Dt FSCK_EXT2FS 8
.Os
.Sh NAME
.Op Fl dfnpy
.Op Fl b Ar block#
.Op Fl m Ar mode
-.Ar filesystem ...
+.Ar filesystem
.Sh DESCRIPTION
.Nm
-performs interactive file system consistency checks and repairs for each of
-the file systems specified.
+performs interactive file system consistency checks and repairs
+the filesystem specified.
It is normally invoked from
.Xr fsck 8 .
.Pp
.Fl p
option,
.Nm
-audits and interactively repairs inconsistent conditions for file systems.
+audits and interactively repairs inconsistent conditions for the filesystem.
If the file system is inconsistent, the operator is prompted for concurrence
before each correction is attempted.
It should be noted that some of the corrective actions which are not
.It Fl d
Print debugging output.
.It Fl f
-Force checking of file systems.
+Force checking of the filesystem.
Normally, if a file system is cleanly unmounted, the kernel will set a
.Dq clean flag
in the file system superblock and
except for
.Dq CONTINUE? ,
which is assumed to be affirmative.
-File systems will not be opened for writing.
+The filesystem will not be opened for writing.
This is the default for file systems to be checked that are
concurrently mounted writable.
.It Fl p
-/* $OpenBSD: main.c,v 1.22 2015/02/07 02:09:13 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.23 2015/10/14 14:33:45 deraadt Exp $ */
/* $NetBSD: main.c,v 1.1 1997/06/11 11:21:50 bouyer Exp $ */
/*
argc -= optind;
argv += optind;
- if (!argc)
+ if (argc != 1)
usage();
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
if (preen)
(void)signal(SIGQUIT, catchquit);
- while (argc-- > 0)
- (void)checkfilesys(blockcheck(*argv++), 0, 0L, 0);
+ (void)checkfilesys(blockcheck(*argv), 0, 0L, 0);
if (returntosingle)
ret = 2;
extern char *__progname;
(void) fprintf(stderr,
- "usage: %s [-dfnpy] [-b block#] [-m mode] filesystem ...\n",
+ "usage: %s [-dfnpy] [-b block#] [-m mode] filesystem\n",
__progname);
exit(1);
}
-.\" $OpenBSD: fsck_ffs.8,v 1.24 2015/07/27 18:46:19 jmc Exp $
+.\" $OpenBSD: fsck_ffs.8,v 1.25 2015/10/14 14:33:45 deraadt Exp $
.\" $NetBSD: fsck_ffs.8,v 1.12 1996/09/23 16:18:34 christos Exp $
.\"
.\" Copyright (c) 1980, 1989, 1991, 1993
.\"
.\" @(#)fsck.8 8.3 (Berkeley) 11/29/94
.\"
-.Dd $Mdocdate: July 27 2015 $
+.Dd $Mdocdate: October 14 2015 $
.Dt FSCK_FFS 8
.Os
.Sh NAME
.Op Fl b Ar block#
.Op Fl c Ar level
.Op Fl m Ar mode
-.Ar filesystem ...
+.Ar filesystem
.Sh DESCRIPTION
.Nm
-performs interactive file system consistency checks and repairs for each
+performs interactive file system consistency checks and repairs the
file system specified.
It is normally invoked from
.Xr fsck 8 .
.Fl p
option,
.Nm
-audits and interactively repairs inconsistent conditions for file systems.
+audits and interactively repairs inconsistent conditions for the filesystem.
If the file system is inconsistent, the operator is prompted for concurrence
before each correction is attempted.
It should be noted that some of the corrective actions which are not
is equal to one, delete any existing segment maps.
.El
.It Fl f
-Force checking of file systems.
+Force checking of the filesystem.
Normally, if a file system is cleanly unmounted, the kernel will set a
.Dq clean flag
in the file system superblock and
except for
.Dq CONTINUE? ,
which is assumed to be affirmative.
-File systems will not be opened for writing.
+The filesystem will not be opened for writing.
This is the default for file systems to be checked that are
concurrently mounted writable.
.It Fl p
Enter preen mode:
.Nm
-will check the file systems on the
-special (raw) devices listed on the command line
+will check the filesystem on the
+special (raw) device listed on the command line
and will make minor repairs without
human intervention.
Any major problems will cause
-/* $OpenBSD: main.c,v 1.44 2015/02/07 02:09:13 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.45 2015/10/14 14:33:45 deraadt Exp $ */
/* $NetBSD: main.c,v 1.22 1996/10/11 20:15:48 thorpej Exp $ */
/*
extern char *__progname;
+void
+usage(void)
+{
+ fprintf(stderr, "usage: %s [-fnpy] [-b block#] [-c level] "
+ "[-m mode] filesystem\n", __progname);
+ exit(1);
+}
int
main(int argc, char *argv[])
{
break;
default:
- errexit("usage: %s [-fnpy] [-b block#] [-c level] "
- "[-m mode] filesystem ...\n", __progname);
+ usage();
}
}
argc -= optind;
argv += optind;
+
+ if (argc != 1)
+ usage();
+
if (signal(SIGINT, SIG_IGN) != SIG_IGN)
(void)signal(SIGINT, catch);
if (preen)
(void)signal(SIGQUIT, catchquit);
(void)signal(SIGINFO, catchinfo);
- if (argc)
- while (argc-- > 0)
- (void)checkfilesys(blockcheck(*argv++), 0, 0L, 0);
+ (void)checkfilesys(blockcheck(*argv), 0, 0L, 0);
if (returntosingle)
ret = 2;
-.\" $OpenBSD: fsck_msdos.8,v 1.15 2015/07/27 18:46:19 jmc Exp $
+.\" $OpenBSD: fsck_msdos.8,v 1.16 2015/10/14 14:33:45 deraadt Exp $
.\" $NetBSD: fsck_msdos.8,v 1.4 1996/10/17 20:41:24 cgd Exp $
.\"
.\" Copyright (C) 1995 Wolfgang Solfrank
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\"
-.Dd $Mdocdate: July 27 2015 $
+.Dd $Mdocdate: October 14 2015 $
.Dt FSCK_MSDOS 8
.Os
.Sh NAME
.Sh SYNOPSIS
.Nm fsck_msdos
.Op Fl fnpy
-.Ar filesystem ...
+.Ar filesystem
.Sh DESCRIPTION
The
.Nm
file systems (more commonly known as
.Tn DOS
file systems).
-It checks the specified file systems and tries to repair all
+It checks the specified filesystem and tries to repair all
detected inconsistencies, requesting confirmation before
making any changes.
.Pp
.Fl p
flag is given,
.Nm
-preens the specified file systems.
+preens the specified filesystem.
It is normally started this way by
.Xr fsck 8
run from
except for
.Dq CONTINUE? ,
which is assumed to be affirmative.
-File systems will not be opened for writing.
+The filesystem will not be opened for writing.
This is the default for file systems to be checked that are
concurrently mounted writable.
.It Fl p
-Preen the specified file systems.
+Preen the specified filesystem.
.It Fl y
Causes
.Nm
-/* $OpenBSD: main.c,v 1.20 2015/09/27 16:56:06 guenther Exp $ */
+/* $OpenBSD: main.c,v 1.21 2015/10/14 14:33:45 deraadt Exp $ */
/* $NetBSD: main.c,v 1.8 1996/10/17 20:29:53 cgd Exp $ */
/*
static void
usage(void)
{
- errexit("usage: fsck_msdos [-fnpy] filesystem ...\n");
+ errexit("usage: fsck_msdos [-fnpy] filesystem\n");
}
int
main(int argc, char *argv[])
{
- int ret = 0, erg;
int ch;
while ((ch = getopt(argc, argv, "pynf")) != -1) {
argc -= optind;
argv += optind;
- if (!argc)
+ if (argc != 1)
usage();
- while (argc-- > 0) {
- setcdevname(*argv, NULL, preen);
- erg = checkfilesys(blockcheck(*argv++));
- if (erg > ret)
- ret = erg;
- }
- exit(ret);
+ setcdevname(*argv, NULL, preen);
+ exit (checkfilesys(blockcheck(*argv)));
}
int