Module Name: src Committed By: kre Date: Sun Jan 7 12:29:25 UTC 2018
Modified Files: src/sbin/dkctl: dkctl.8 dkctl.c Log Message: PR bin/52905 Document, and properly implement, the -q and -e options to dkctl xxN listwedges. (implementation fix supplied by Petar Bogdanovic.) To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sbin/dkctl/dkctl.8 cvs rdiff -u -r1.25 -r1.26 src/sbin/dkctl/dkctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/dkctl/dkctl.8 diff -u src/sbin/dkctl/dkctl.8:1.26 src/sbin/dkctl/dkctl.8:1.27 --- src/sbin/dkctl/dkctl.8:1.26 Wed Jan 6 23:01:11 2016 +++ src/sbin/dkctl/dkctl.8 Sun Jan 7 12:29:25 2018 @@ -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 @@ the disk device. 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. Index: src/sbin/dkctl/dkctl.c diff -u src/sbin/dkctl/dkctl.c:1.25 src/sbin/dkctl/dkctl.c:1.26 --- src/sbin/dkctl/dkctl.c:1.25 Wed Apr 5 20:27:09 2017 +++ src/sbin/dkctl/dkctl.c Sun Jan 7 12:29:25 2018 @@ -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 @@ disk_listwedges(int argc, char *argv[]) return; } + if (quiet) + return; + qsort(dkw, dkwl.dkwl_nwedges, sizeof(*dkw), dkw_sort); printf("%s: %u wedge%s:\n", dvname, dkwl.dkwl_nwedges,