From owner-freebsd-current@FreeBSD.ORG Wed Oct 23 03:55:37 2013 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 490F7AF9 for ; Wed, 23 Oct 2013 03:55:37 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A5332E43 for ; Wed, 23 Oct 2013 03:55:36 +0000 (UTC) Received: from alph.d.allbsd.org (p4181-ipbf1307funabasi.chiba.ocn.ne.jp [123.225.173.181]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id r9N3tC0q083396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Oct 2013 12:55:23 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.7/8.14.5) with ESMTP id r9N3tAKO028074; Wed, 23 Oct 2013 12:55:12 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 23 Oct 2013 12:54:29 +0900 (JST) Message-Id: <20131023.125429.1473962573103517143.hrs@allbsd.org> To: jhs@berklix.com Subject: Re: Regression in 10.0-BETA1, mdconfig has changed its return code. From: Hiroki Sato In-Reply-To: <201310230254.r9N2slD1067094@fire.js.berklix.net> References: <201310230254.r9N2slD1067094@fire.js.berklix.net> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart0(Wed_Oct_23_12_54_29_2013_858)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Wed, 23 Oct 2013 12:55:24 +0900 (JST) X-Spam-Status: No, score=-99.1 required=13.0 tests=CONTENT_TYPE_PRESENT, SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: current@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 03:55:37 -0000 ----Security_Multipart0(Wed_Oct_23_12_54_29_2013_858)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Wed_Oct_23_12_54_29_2013_828)--" Content-Transfer-Encoding: 7bit ----Next_Part(Wed_Oct_23_12_54_29_2013_828)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Julian H. Stacey" wrote in <201310230254.r9N2slD1067094@fire.js.berklix.net>: jh> Regresssion in 10.0-BETA1, mdconfig -l -v return code changed from 0 jh> to 255. OK, its not specfied in manual, but has changed. jh> A test script I was using caught it: jh> http://www.berklix.com/~jhs/bin/sh/mdconfig_tst jh> Probably in next day or 2 I'll hack the C & send-pr. Does the attached patch fix it? -- Hiroki ----Next_Part(Wed_Oct_23_12_54_29_2013_828)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mdconfig_20131023-1.diff" Index: sbin/mdconfig/mdconfig.c =================================================================== --- sbin/mdconfig/mdconfig.c (revision 256952) +++ sbin/mdconfig/mdconfig.c (working copy) @@ -481,12 +481,18 @@ printf("\n"); /* XXX: Check if it's enough to clean everything. */ geom_stats_snapshot_free(sq); - if (((opt & OPT_UNIT) && (fflag == NULL) && ufound) || - ((opt & OPT_UNIT) == 0 && (fflag != NULL) && ffound) || - ((opt & OPT_UNIT) && (fflag != NULL) && ufound && ffound)) - return (0); - else - return (-1); + if (opt & OPT_UNIT) { + if (((fflag == NULL) && ufound) || + ((fflag == NULL) && (units != NULL) && ufound) || + ((fflag != NULL) && ffound) || + ((fflag != NULL) && (units != NULL) && ufound && ffound)) + return (0); + } else if (opt & OPT_LIST) { + if ((fflag == NULL) || + ((fflag != NULL) && ffound)) + return (0); + } + return (-1); } /* ----Next_Part(Wed_Oct_23_12_54_29_2013_828)---- ----Security_Multipart0(Wed_Oct_23_12_54_29_2013_858)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlJnSHUACgkQTyzT2CeTzy1DmwCeO5keda5VeI77WcQc1bBHjQcH Z2AAoM7AWam+zG2YwlaibM+uE3KTmPHL =GxeR -----END PGP SIGNATURE----- ----Security_Multipart0(Wed_Oct_23_12_54_29_2013_858)----