summaryrefslogtreecommitdiffstats
path: root/sbin/kldstat
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-11-13 16:49:07 +0000
committerkib <kib@FreeBSD.org>2010-11-13 16:49:07 +0000
commit9a3df669894f81d2f354bfbb8393accf365d3daa (patch)
treeec348434ab1bb2dfd38f1ca2b269f5f2cfebcac3 /sbin/kldstat
parent71d00a95d70efe5f34c3df05fecbdd0ab20fb97a (diff)
downloadFreeBSD-src-9a3df669894f81d2f354bfbb8393accf365d3daa.zip
FreeBSD-src-9a3df669894f81d2f354bfbb8393accf365d3daa.tar.gz
In printfile(), exit the process instead of only printing the warning.
This fixes verbose mode when either -i specified non-existent kldfile id, or the file was unloaded between two kldnext(2) calls. While there, fix printfile() definition to be style(9)-compliant. Submitted by: arundel MFC after: 1 week
Diffstat (limited to 'sbin/kldstat')
-rw-r--r--sbin/kldstat/kldstat.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/kldstat/kldstat.c b/sbin/kldstat/kldstat.c
index 78182b9..575fca8 100644
--- a/sbin/kldstat/kldstat.c
+++ b/sbin/kldstat/kldstat.c
@@ -50,14 +50,15 @@ printmod(int modid)
printf("\t\t%2d %s\n", stat.id, stat.name);
}
-static void printfile(int fileid, int verbose)
+static void
+printfile(int fileid, int verbose)
{
struct kld_file_stat stat;
int modid;
stat.version = sizeof(struct kld_file_stat);
if (kldstat(fileid, &stat) < 0)
- warn("can't stat file id %d", fileid);
+ err(1, "can't stat file id %d", fileid);
else
printf("%2d %4d %p %-8zx %s",
stat.id, stat.refs, stat.address, stat.size,
OpenPOWER on IntegriCloud