From conrads@serene.no-ip.org  Mon Mar 26 06:15:26 2012
Return-Path: <conrads@serene.no-ip.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 6B5DB106566C
	for <freebsd-gnats-submit@freebsd.org>; Mon, 26 Mar 2012 06:15:26 +0000 (UTC)
	(envelope-from conrads@serene.no-ip.org)
Received: from eastrmfepo103.cox.net (eastrmfepo103.cox.net [68.230.241.215])
	by mx1.freebsd.org (Postfix) with ESMTP id F37C98FC15
	for <freebsd-gnats-submit@freebsd.org>; Mon, 26 Mar 2012 06:15:25 +0000 (UTC)
Received: from eastrmimpo209.cox.net ([68.230.241.224])
          by eastrmfepo103.cox.net
          (InterMail vM.8.01.04.00 201-2260-137-20101110) with ESMTP
          id <20120326061514.SLJI8874.eastrmfepo103.cox.net@eastrmimpo209.cox.net>
          for <freebsd-gnats-submit@freebsd.org>;
          Mon, 26 Mar 2012 02:15:14 -0400
Received: from serene.no-ip.org ([98.164.84.176])
	by eastrmimpo209.cox.net with bizsmtp
	id q6F21i0033oG0Ji026F45W; Mon, 26 Mar 2012 02:15:14 -0400
Received: from serene.no-ip.org (localhost [127.0.0.1])
	by serene.no-ip.org (8.14.5/8.14.5) with ESMTP id q2Q6F1Xa009930
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Mar 2012 01:15:01 -0500 (CDT)
	(envelope-from conrads@serene.no-ip.org)
Received: (from root@localhost)
	by serene.no-ip.org (8.14.5/8.14.5/Submit) id q2Q6EuJ5009929;
	Mon, 26 Mar 2012 01:14:56 -0500 (CDT)
	(envelope-from conrads)
Message-Id: <201203260614.q2Q6EuJ5009929@serene.no-ip.org>
Date: Mon, 26 Mar 2012 01:14:56 -0500 (CDT)
From: "Conrad J. Sabatier" <conrads@cox.net>
Reply-To: "Conrad J. Sabatier" <conrads@cox.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch (resubmission)] src/usr.sbin/mptutil/mpt_show.c
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         166404
>Category:       bin
>Synopsis:       [patch] mptutil(8): (resubmission) src/usr.sbin/mptutil/mpt_show.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    eadler
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 26 06:20:08 UTC 2012
>Closed-Date:    Thu Jun 14 06:58:58 UTC 2012
>Last-Modified:  Thu Jun 14 07:00:16 UTC 2012
>Originator:     Conrad J. Sabatier
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
System: FreeBSD serene.no-ip.org 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Sun Feb 12 19:15:46 CST 2012 conrads@serene.no-ip.org:/usr/obj/usr/src/sys/CUSTOM amd64

>Description:

When building world with DEBUG defined, the build fails in the file
"usr.sbin/mptutil/mpt_show.c" in function "show_physdisks()".  This 
function is wrapped in an #idfef DEBUG conditional and so will not cause 
any problems when DEBUG is not defined, but when it is, an 'undefined 
identifier' error occurs due to there being no declaration for the 
variable 'error' (which *is* declared in other, similar functions which 
aren't DEBUG-dependent).

I originally submitted this patch back in late January, but it seems to 
have somehow simply "fallen through the cracks".

>How-To-Repeat:

Define DEBUG on a buildworld.  Sit back and wait for the inevitable.

>Fix:

patch below

--- mptutil.diff begins here ---
Index: src/usr.sbin/mptutil/mpt_show.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/mptutil/mpt_show.c,v
retrieving revision 1.3
diff -u -r1.3 mpt_show.c
--- src/usr.sbin/mptutil/mpt_show.c	9 Nov 2010 19:28:06 -0000	1.3
+++ src/usr.sbin/mptutil/mpt_show.c	31 Jan 2012 19:22:16 -0000
@@ -538,7 +538,7 @@
 {
 	CONFIG_PAGE_RAID_PHYS_DISK_0 *pinfo;
 	U16 IOCStatus;
-	int fd, i;
+	int error, fd, i;
 
 	if (ac != 1) {
 		warnx("show drives: extra arguments");
--- mptutil.diff ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sun May 13 22:27:27 UTC 2012 
Responsible-Changed-Why:  
this may fail with clang or gcc48, I'll take to test and commit 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166404 
State-Changed-From-To: open->analyzed 
State-Changed-By: eadler 
State-Changed-When: Wed May 16 23:27:28 UTC 2012 
State-Changed-Why:  
awaiting approval 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166404 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/166404: commit references a PR
Date: Wed, 30 May 2012 03:57:58 +0000 (UTC)

 Author: eadler
 Date: Wed May 30 03:57:49 2012
 New Revision: 236287
 URL: http://svn.freebsd.org/changeset/base/236287
 
 Log:
   add missing variable declaration when DEBUG is defined forgotten in
   r215046
   
   PR:		bin/166404
   Submitted by:	"Conrad J. Sabatier" <conrads@cox.net>
   Approved by:	cperciva
   MFC after:	3 days
 
 Modified:
   head/usr.sbin/mptutil/mpt_show.c
 
 Modified: head/usr.sbin/mptutil/mpt_show.c
 ==============================================================================
 --- head/usr.sbin/mptutil/mpt_show.c	Wed May 30 03:55:44 2012	(r236286)
 +++ head/usr.sbin/mptutil/mpt_show.c	Wed May 30 03:57:49 2012	(r236287)
 @@ -538,7 +538,7 @@ show_physdisks(int ac, char **av)
  {
  	CONFIG_PAGE_RAID_PHYS_DISK_0 *pinfo;
  	U16 IOCStatus;
 -	int fd, i;
 +	int error, fd, i;
  
  	if (ac != 1) {
  		warnx("show drives: extra arguments");
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: analyzed->patched 
State-Changed-By: eadler 
State-Changed-When: Wed May 30 04:17:18 UTC 2012 
State-Changed-Why:  
committed, awaiting MFC 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166404 
State-Changed-From-To: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Thu Jun 14 06:58:57 UTC 2012 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=166404 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/166404: commit references a PR
Date: Thu, 14 Jun 2012 06:54:55 +0000 (UTC)

 Author: eadler
 Date: Thu Jun 14 06:54:35 2012
 New Revision: 237048
 URL: http://svn.freebsd.org/changeset/base/237048
 
 Log:
   MFC r236287:
   	add missing variable declaration when DEBUG is defined forgotten in r215046
   
   PR:		bin/166404
   Approved by:	cperciva (implicit)
 
 Modified:
   stable/9/usr.sbin/mptutil/mpt_show.c
 Directory Properties:
   stable/9/usr.sbin/mptutil/   (props changed)
 
 Modified: stable/9/usr.sbin/mptutil/mpt_show.c
 ==============================================================================
 --- stable/9/usr.sbin/mptutil/mpt_show.c	Thu Jun 14 06:26:58 2012	(r237047)
 +++ stable/9/usr.sbin/mptutil/mpt_show.c	Thu Jun 14 06:54:35 2012	(r237048)
 @@ -538,7 +538,7 @@ show_physdisks(int ac, char **av)
  {
  	CONFIG_PAGE_RAID_PHYS_DISK_0 *pinfo;
  	U16 IOCStatus;
 -	int fd, i;
 +	int error, fd, i;
  
  	if (ac != 1) {
  		warnx("show drives: extra arguments");
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/166404: commit references a PR
Date: Thu, 14 Jun 2012 06:55:25 +0000 (UTC)

 Author: eadler
 Date: Thu Jun 14 06:55:16 2012
 New Revision: 237050
 URL: http://svn.freebsd.org/changeset/base/237050
 
 Log:
   MFC r236287:
   	add missing variable declaration when DEBUG is defined forgotten in r215046
   
   PR:		bin/166404
   Approved by:	cperciva (implicit)
 
 Modified:
   stable/8/usr.sbin/mptutil/mpt_show.c
 Directory Properties:
   stable/8/usr.sbin/mptutil/   (props changed)
 
 Modified: stable/8/usr.sbin/mptutil/mpt_show.c
 ==============================================================================
 --- stable/8/usr.sbin/mptutil/mpt_show.c	Thu Jun 14 06:54:48 2012	(r237049)
 +++ stable/8/usr.sbin/mptutil/mpt_show.c	Thu Jun 14 06:55:16 2012	(r237050)
 @@ -538,7 +538,7 @@ show_physdisks(int ac, char **av)
  {
  	CONFIG_PAGE_RAID_PHYS_DISK_0 *pinfo;
  	U16 IOCStatus;
 -	int fd, i;
 +	int error, fd, i;
  
  	if (ac != 1) {
  		warnx("show drives: extra arguments");
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/166404: commit references a PR
Date: Thu, 14 Jun 2012 06:55:49 +0000 (UTC)

 Author: eadler
 Date: Thu Jun 14 06:55:40 2012
 New Revision: 237051
 URL: http://svn.freebsd.org/changeset/base/237051
 
 Log:
   MFC r236287:
   	add missing variable declaration when DEBUG is defined forgotten in r215046
   
   PR:		bin/166404
   Approved by:	cperciva (implicit)
 
 Modified:
   stable/7/usr.sbin/mptutil/mpt_show.c
 Directory Properties:
   stable/7/usr.sbin/mptutil/   (props changed)
 
 Modified: stable/7/usr.sbin/mptutil/mpt_show.c
 ==============================================================================
 --- stable/7/usr.sbin/mptutil/mpt_show.c	Thu Jun 14 06:55:16 2012	(r237050)
 +++ stable/7/usr.sbin/mptutil/mpt_show.c	Thu Jun 14 06:55:40 2012	(r237051)
 @@ -538,7 +538,7 @@ show_physdisks(int ac, char **av)
  {
  	CONFIG_PAGE_RAID_PHYS_DISK_0 *pinfo;
  	U16 IOCStatus;
 -	int fd, i;
 +	int error, fd, i;
  
  	if (ac != 1) {
  		warnx("show drives: extra arguments");
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
