Date: Wed, 22 Jan 2014 17:15:17 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261032 - head/sbin/kldstat Message-ID: <201401221715.s0MHFHQp064343@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Wed Jan 22 17:15:17 2014 New Revision: 261032 URL: http://svnweb.freebsd.org/changeset/base/261032 Log: Add quiet support for kldstat -n PR: bin/180014 Submitted by: Olivier Cochard-Labbé <olivier@cochard.me> MFC after: 1 week Modified: head/sbin/kldstat/kldstat.8 head/sbin/kldstat/kldstat.c Modified: head/sbin/kldstat/kldstat.8 ============================================================================== --- head/sbin/kldstat/kldstat.8 Wed Jan 22 16:59:53 2014 (r261031) +++ head/sbin/kldstat/kldstat.8 Wed Jan 22 17:15:17 2014 (r261032) @@ -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 Modified: head/sbin/kldstat/kldstat.c ============================================================================== --- head/sbin/kldstat/kldstat.c Wed Jan 22 16:59:53 2014 (r261031) +++ head/sbin/kldstat/kldstat.c Wed Jan 22 17:15:17 2014 (r261032) @@ -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, ' ');
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401221715.s0MHFHQp064343>