From b1e3b56953a5b6990cf533fc04002f062cbce734 Mon Sep 17 00:00:00 2001 From: charnier Date: Thu, 4 Jun 1998 06:44:18 +0000 Subject: Correct .Nm. Spelling. Add rcsid, remove unused #includes. Add usage(). Do not dot-terminate errx() strings. --- sbin/clri/clri.8 | 12 ++++++------ sbin/clri/clri.c | 25 ++++++++++++++++--------- 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 -#include #include #include #include -#include #include #include #include #include #include +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. */ -- cgit v1.1