Date: Sat, 13 Nov 2010 16:49:07 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r215248 - head/sbin/kldstat Message-ID: <201011131649.oADGn7xA053634@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sat Nov 13 16:49:07 2010 New Revision: 215248 URL: http://svn.freebsd.org/changeset/base/215248 Log: 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 Modified: head/sbin/kldstat/kldstat.c Modified: head/sbin/kldstat/kldstat.c ============================================================================== --- head/sbin/kldstat/kldstat.c Sat Nov 13 15:28:44 2010 (r215247) +++ head/sbin/kldstat/kldstat.c Sat Nov 13 16:49:07 2010 (r215248) @@ -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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011131649.oADGn7xA053634>