Correct .Nm. Spelling. Add rcsid, remove unused #includes. Add usage(). Do not

dot-terminate errx() strings.
This commit is contained in:
Philippe Charnier 1998-06-04 06:44:18 +00:00
parent 4e9648a861
commit ec74b3f3ea
2 changed files with 22 additions and 15 deletions

View File

@ -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.

View File

@ -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. */