fsck_msdosfs/main.c:
- Don't use errexit() to (mis)implement usage(). Using errexit() just gave the bogus exit code 8. - Fixed 3 other style bugs in usage(). fsck/fsutil.[ch]: - Garbage-collected errexit(). It is essentially just one of NetBSD's fsck_ext2fs error printing functions, but we don't have fsck_ext2fs and the function is unsuitable for use there too (since pfatal() is also used and it printf to a different stream).
This commit is contained in:
parent
2d13f3377f
commit
05a8df3c21
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=123888
@ -79,18 +79,6 @@ hotroot(void)
|
|||||||
return hot;
|
return hot;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*VARARGS*/
|
|
||||||
void
|
|
||||||
errexit(const char *fmt, ...)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
|
||||||
(void) vfprintf(stderr, fmt, ap);
|
|
||||||
va_end(ap);
|
|
||||||
exit(8);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vmsg(int fatal, const char *fmt, va_list ap)
|
vmsg(int fatal, const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
|
@ -31,8 +31,6 @@
|
|||||||
* $FreeBSD$
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void errexit(const char *, ...)
|
|
||||||
__attribute__((__noreturn__,__format__(__printf__,1,2)));
|
|
||||||
void pfatal(const char *, ...)
|
void pfatal(const char *, ...)
|
||||||
__attribute__((__format__(__printf__,1,2)));
|
__attribute__((__format__(__printf__,1,2)));
|
||||||
void pwarn(const char *, ...)
|
void pwarn(const char *, ...)
|
||||||
|
@ -58,9 +58,11 @@ int rdonly; /* device is opened read only (supersedes above) */
|
|||||||
static void usage(void) __dead2;
|
static void usage(void) __dead2;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage()
|
usage(void)
|
||||||
{
|
{
|
||||||
errexit("usage: fsck_msdos [-fnpy] filesystem ... \n");
|
|
||||||
|
fprintf(stderr, "usage: fsck_msdos [-fnpy] filesystem ...\n");
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Loading…
Reference in New Issue
Block a user