diff options
Diffstat (limited to 'sbin/clri/clri.c')
-rw-r--r-- | sbin/clri/clri.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/sbin/clri/clri.c b/sbin/clri/clri.c index c2bdccc..1841201 100644 --- a/sbin/clri/clri.c +++ b/sbin/clri/clri.c @@ -41,7 +41,7 @@ static char copyright[] = #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)clri.c 8.2 (Berkeley) 9/23/93"; +static char sccsid[] = "@(#)clri.c 8.3 (Berkeley) 4/28/95"; #endif /* not lint */ #include <sys/param.h> @@ -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. */ |