>Number:         180014
>Category:       bin
>Synopsis:       Patch for kldstat: add quiet option to filename mode
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 26 22:50:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Olivier Cochard-Labbé
>Release:        current
>Organization:
BSD Router Project
>Environment:
FreeBSD orange.bsdrp.net 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r252056M: Fri Jun 
21 17:24:08 CEST 2013     
r...@orange.bsdrp.net:/usr/obj/usr/local/BSDRP/BSDRPcur/FreeBSD/src/sys/PROD  
amd64

>Description:
kldstat have a quiet (-q) option, but it's supported only for modulname (-m) 
and not for filename (-n).
This patch add quiet option for filename too.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- kldstat.c.orig      2013-06-27 00:19:44.339868707 +0200
+++ kldstat.c   2013-06-27 00:34:52.730802738 +0200
@@ -78,7 +78,7 @@
 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 @@
     }
 
     if (filename != NULL) {
-       if ((fileid = kldfind(filename)) < 0)
-           err(1, "can't find file %s", filename);
+               if ((fileid = kldfind(filename)) < 0) {
+                       if (!quiet)
+               err(1, "can't find file %s", filename);
+                       return 1;
+               } else if (quiet) {
+                       return 0;
+               }
     }
 
     printf("Id Refs Address%*c Size     Name\n", POINTER_WIDTH - 7, ' ');


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to