aboutsummaryrefslogtreecommitdiff
path: root/sbin/clri
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>1998-06-04 06:44:18 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>1998-06-04 06:44:18 +0000
commitec74b3f3ea80e3fd18cb267b7aa23ea7a17a7070 (patch)
treec96c5d088cc112366b0f268be33d64801992ddbf /sbin/clri
parent4e9648a861486fb773ae632531613d1ad27c7693 (diff)
downloadsrc-ec74b3f3ea80e3fd18cb267b7aa23ea7a17a7070.tar.gz
src-ec74b3f3ea80e3fd18cb267b7aa23ea7a17a7070.zip
Correct .Nm. Spelling. Add rcsid, remove unused #includes. Add usage(). Do not
dot-terminate errx() strings.
Notes
Notes: svn path=/head/; revision=36630
Diffstat (limited to 'sbin/clri')
-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 187c79019b78..710e863abe87 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 97505871e616..28c2e74cc18f 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. */