Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/dkctl PR bin/52905



details:   https://anonhg.NetBSD.org/src/rev/4629f8c3b65e
branches:  trunk
changeset: 828846:4629f8c3b65e
user:      kre <kre%NetBSD.org@localhost>
date:      Sun Jan 07 12:29:25 2018 +0000

description:
PR bin/52905

Document, and properly implement, the -q and -e options to dkctl xxN listwedges.
(implementation fix supplied by Petar Bogdanovic.)

diffstat:

 sbin/dkctl/dkctl.8 |  12 ++++++++++--
 sbin/dkctl/dkctl.c |   7 +++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

diffs (55 lines):

diff -r 4b11e8a5204d -r 4629f8c3b65e sbin/dkctl/dkctl.8
--- a/sbin/dkctl/dkctl.8        Sun Jan 07 11:37:30 2018 +0000
+++ b/sbin/dkctl/dkctl.8        Sun Jan 07 12:29:25 2018 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: dkctl.8,v 1.26 2016/01/06 23:01:11 wiz Exp $
+.\"    $NetBSD: dkctl.8,v 1.27 2018/01/07 12:29:25 kre Exp $
 .\"
 .\" Copyright 2002 Wasabi Systems, Inc.
 .\" All rights reserved.
@@ -139,8 +139,16 @@
 is specified, drop if
 .Ar no
 is specified.)
-.It Ic listwedges
+.It Ic listwedges Oo Fl e Oc Op Fl q
 List all of the wedges configured on the specified disk.
+With
+.Fl e
+exit with a non-zero exit status if there are no wedges
+configured on that disk.
+With
+.Fl q
+(quiet mode)
+there is no output related to the wedges that do, or do not, exist.
 .It Ic makewedges
 Delete all wedges configured on the specified disk, and autodiscover
 the wedges again.
diff -r 4b11e8a5204d -r 4629f8c3b65e sbin/dkctl/dkctl.c
--- a/sbin/dkctl/dkctl.c        Sun Jan 07 11:37:30 2018 +0000
+++ b/sbin/dkctl/dkctl.c        Sun Jan 07 12:29:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dkctl.c,v 1.25 2017/04/05 20:27:09 jdolecek Exp $      */
+/*     $NetBSD: dkctl.c,v 1.26 2018/01/07 12:29:25 kre Exp $   */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: dkctl.c,v 1.25 2017/04/05 20:27:09 jdolecek Exp $");
+__RCSID("$NetBSD: dkctl.c,v 1.26 2018/01/07 12:29:25 kre Exp $");
 #endif
 
 #include <sys/param.h>
@@ -684,6 +684,9 @@
                return;
        }
 
+       if (quiet)
+               return;
+
        qsort(dkw, dkwl.dkwl_nwedges, sizeof(*dkw), dkw_sort);
 
        printf("%s: %u wedge%s:\n", dvname, dkwl.dkwl_nwedges,



Home | Main Index | Thread Index | Old Index