mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-29 12:03:03 +00:00
Give variable an initial value. Use errx() instead of fprintf().
This commit is contained in:
parent
865059c8a8
commit
8a1dff0c73
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146757
@ -41,6 +41,7 @@ static const char copyright[] =
|
||||
static char sccsid[] = "@(#)clri.c 8.2 (Berkeley) 9/23/93";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
@ -85,6 +86,7 @@ main(int argc, char *argv[])
|
||||
usage();
|
||||
|
||||
fs = *++argv;
|
||||
sbp = NULL;
|
||||
|
||||
/* get the superblock. */
|
||||
if ((fd = open(fs, O_RDWR, 0)) < 0)
|
||||
@ -102,10 +104,8 @@ main(int argc, char *argv[])
|
||||
sbp->fs_bsize >= (int)sizeof(struct fs))
|
||||
break;
|
||||
}
|
||||
if (sblock_try[i] == -1) {
|
||||
fprintf(stderr, "Cannot find file system superblock\n");
|
||||
exit(2);
|
||||
}
|
||||
if (sblock_try[i] == -1)
|
||||
errx(2, "cannot find file system superblock");
|
||||
bsize = sbp->fs_bsize;
|
||||
|
||||
/* remaining arguments are inode numbers. */
|
||||
|
Loading…
Reference in New Issue
Block a user