summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1998-06-04 06:44:18 +0000
committercharnier <charnier@FreeBSD.org>1998-06-04 06:44:18 +0000
commitb1e3b56953a5b6990cf533fc04002f062cbce734 (patch)
tree9f6d3478e9bde094be3183e3638f7729ba1a6fbd
parent42bfb0ad249e7cf16270c29043cc5f3a30cee657 (diff)
downloadFreeBSD-src-b1e3b56953a5b6990cf533fc04002f062cbce734.zip
FreeBSD-src-b1e3b56953a5b6990cf533fc04002f062cbce734.tar.gz
Correct .Nm. Spelling. Add rcsid, remove unused #includes. Add usage(). Do not
dot-terminate errx() strings.
-rw-r--r--sbin/clri/clri.812
-rw-r--r--sbin/clri/clri.c25
2 files changed, 22 insertions, 15 deletions
diff --git a/sbin/clri/clri.8 b/sbin/clri/clri.8
index 187c790..710e863 100644
--- a/sbin/clri/clri.8
+++ b/sbin/clri/clri.8
@@ -10,7 +10,7 @@
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
+.\" must display the following acknowledgment:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)clri.8 8.2 (Berkeley) 4/19/94
-.\" $Id$
+.\" $Id: clri.8,v 1.5 1997/02/22 14:32:11 peter Exp $
.\"
.Dd April 19, 1994
.Dt CLRI 8
@@ -55,8 +55,8 @@ on the filesystem residing on the given
The
.Xr fsck 8
utility is usually run after
-.Nm clri
-to reclaim the zero'ed inode(s) and the
+.Nm
+to reclaim the zeroed inode(s) and the
blocks previously claimed by those inode(s).
Both read and write permission are required on the specified
.Ar special_device .
@@ -69,10 +69,10 @@ Once removed,
it is anticipated that
.Xr fsck 8
will be able to clean up the resulting mess.
-.Sh "SEE ALSO"
+.Sh SEE ALSO
.Xr fsck 8 ,
.Xr fsdb 8
.Sh BUGS
If the file is open, the work of
-.Nm clri
+.Nm
will be lost when the inode is written back to disk from the inode cache.
diff --git a/sbin/clri/clri.c b/sbin/clri/clri.c
index 9750587..28c2e74 100644
--- a/sbin/clri/clri.c
+++ b/sbin/clri/clri.c
@@ -35,29 +35,38 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1990, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
+#if 0
static char sccsid[] = "@(#)clri.c 8.2 (Berkeley) 9/23/93";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
-#include <sys/time.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
#include <err.h>
-#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
+static void
+usage(void)
+{
+ (void)fprintf(stderr, "usage: clri filesystem inode ...\n");
+ exit(1);
+}
+
int
main(argc, argv)
int argc;
@@ -72,10 +81,8 @@ main(argc, argv)
int inonum;
char *fs, sblock[SBSIZE];
- if (argc < 3) {
- (void)fprintf(stderr, "usage: clri filesystem inode ...\n");
- exit(1);
- }
+ if (argc < 3)
+ usage();
fs = *++argv;
@@ -89,7 +96,7 @@ main(argc, argv)
sbp = (struct fs *)sblock;
if (sbp->fs_magic != FS_MAGIC)
- errx(1, "%s: superblock magic number 0x%x, not 0x%x.",
+ errx(1, "%s: superblock magic number 0x%x, not 0x%x",
fs, sbp->fs_magic, FS_MAGIC);
bsize = sbp->fs_bsize;
@@ -97,7 +104,7 @@ main(argc, argv)
while (*++argv) {
/* get the inode number. */
if ((inonum = atoi(*argv)) <= 0)
- errx(1, "%s is not a valid inode number.", *argv);
+ errx(1, "%s is not a valid inode number", *argv);
(void)printf("clearing %d\n", inonum);
/* read in the appropriate block. */
OpenPOWER on IntegriCloud