aboutsummaryrefslogtreecommitdiff
path: root/sbin/clri
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>1997-06-04 06:46:09 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>1997-06-04 06:46:09 +0000
commita715c4a4dd788f7a55f0508e89240f168f352443 (patch)
tree804c0ed0541bd1853b21b25437d000b19d9795c7 /sbin/clri
parentf60d7bbf349b7c308f9a03a776b42bfaf8cd1af6 (diff)
downloadsrc-a715c4a4dd788f7a55f0508e89240f168f352443.tar.gz
src-a715c4a4dd788f7a55f0508e89240f168f352443.zip
Use errx instead of fprintf/exit.
Notes
Notes: svn path=/head/; revision=26438
Diffstat (limited to 'sbin/clri')
-rw-r--r--sbin/clri/clri.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/sbin/clri/clri.c b/sbin/clri/clri.c
index c2bdcccc1d9d..97505871e616 100644
--- a/sbin/clri/clri.c
+++ b/sbin/clri/clri.c
@@ -84,29 +84,20 @@ main(argc, argv)
err(1, "%s", fs);
if (lseek(fd, (off_t)(SBLOCK * DEV_BSIZE), SEEK_SET) < 0)
err(1, "%s", fs);
- if (read(fd, sblock, sizeof(sblock)) != sizeof(sblock)) {
- (void)fprintf(stderr,
- "clri: %s: can't read the superblock.\n", fs);
- exit(1);
- }
+ if (read(fd, sblock, sizeof(sblock)) != sizeof(sblock))
+ errx(1, "%s: can't read superblock", fs);
sbp = (struct fs *)sblock;
- if (sbp->fs_magic != FS_MAGIC) {
- (void)fprintf(stderr,
- "clri: %s: superblock magic number 0x%x, not 0x%x.\n",
+ if (sbp->fs_magic != FS_MAGIC)
+ errx(1, "%s: superblock magic number 0x%x, not 0x%x.",
fs, sbp->fs_magic, FS_MAGIC);
- exit(1);
- }
bsize = sbp->fs_bsize;
/* remaining arguments are inode numbers. */
while (*++argv) {
/* get the inode number. */
- if ((inonum = atoi(*argv)) <= 0) {
- (void)fprintf(stderr,
- "clri: %s is not a valid inode number.\n", *argv);
- exit(1);
- }
+ if ((inonum = atoi(*argv)) <= 0)
+ errx(1, "%s is not a valid inode number.", *argv);
(void)printf("clearing %d\n", inonum);
/* read in the appropriate block. */