mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 18:59:37 +00:00
Add quiet support for kldstat -n
PR: bin/180014 Submitted by: Olivier Cochard-Labbé <olivier@cochard.me> MFC after: 1 week
This commit is contained in:
parent
08c2799ac3
commit
a1330eaa5d
@ -25,7 +25,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd September 23, 2005
|
||||
.Dd January 22, 2014
|
||||
.Dt KLDSTAT 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -33,6 +33,7 @@
|
||||
.Nd display status of dynamic kernel linker
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl q
|
||||
.Op Fl v
|
||||
.Op Fl i Ar id
|
||||
.Op Fl n Ar filename
|
||||
|
@ -78,7 +78,7 @@ printfile(int fileid, int verbose)
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: kldstat [-v] [-i id] [-n filename]\n");
|
||||
fprintf(stderr, "usage: kldstat [-q] [-v] [-i id] [-n filename]\n");
|
||||
fprintf(stderr, " kldstat [-q] [-m modname]\n");
|
||||
exit(1);
|
||||
}
|
||||
@ -146,8 +146,13 @@ main(int argc, char** argv)
|
||||
}
|
||||
|
||||
if (filename != NULL) {
|
||||
if ((fileid = kldfind(filename)) < 0)
|
||||
err(1, "can't find file %s", filename);
|
||||
if ((fileid = kldfind(filename)) < 0) {
|
||||
if (!quiet)
|
||||
warn("can't find file %s", filename);
|
||||
return 1;
|
||||
} else if (quiet) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
printf("Id Refs Address%*c Size Name\n", POINTER_WIDTH - 7, ' ');
|
||||
|
Loading…
Reference in New Issue
Block a user