From naddy@bigeye.rhein-neckar.de Wed Jun 23 00:39:36 1999
Return-Path: <naddy@bigeye.rhein-neckar.de>
Received: from news-ma.rhein-neckar.de (news-ma.rhein-neckar.de [193.197.90.3])
	by hub.freebsd.org (Postfix) with ESMTP id 1AD9414D01
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Jun 1999 00:39:23 -0700 (PDT)
	(envelope-from naddy@bigeye.rhein-neckar.de)
Received: from mips.rhein-neckar.de (uucp@localhost)
	by news-ma.rhein-neckar.de (8.8.8/8.8.8) with bsmtp id JAA20689
	for FreeBSD-gnats-submit@freebsd.org; Wed, 23 Jun 1999 09:39:22 +0200 (CEST)
	(envelope-from naddy@bigeye.rhein-neckar.de)
Received: from bigeye.rhein-neckar.de ([193.197.90.235]) by mips.rhein-neckar.de
	 with esmtp id m10wZOT-000WyUC
	(Debian Smail-3.2.0.101 1997-Dec-17 #2); Wed, 23 Jun 1999 00:51:53 +0200 (CEST)
Received: (from naddy@localhost)
	by bigeye.rhein-neckar.de (8.9.3/8.9.3) id AAA02365;
	Wed, 23 Jun 1999 00:52:27 +0200 (CEST)
	(envelope-from naddy)
Message-Id: <199906222252.AAA02365@bigeye.rhein-neckar.de>
Date: Wed, 23 Jun 1999 00:52:27 +0200 (CEST)
From: Christian Weisgerber <naddy@mips.rhein-neckar.de>
Sender: naddy@bigeye.rhein-neckar.de
Reply-To: naddy@mips.rhein-neckar.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: Patch: "camcontrol help" should go to stdout
X-Send-Pr-Version: 3.2

>Number:         12358
>Category:       bin
>Synopsis:       Patch: "camcontrol help" should go to stdout
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ken
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 23 00:40:02 PDT 1999
>Closed-Date:    Fri Aug 09 22:38:18 PDT 2002
>Last-Modified:  Fri Aug 09 22:38:18 PDT 2002
>Originator:     Christian Weisgerber
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
>Environment:

n/a

>Description:

"camcontrol help" outputs usage information to stderr rather than
stdout. This is non-standard behavior. Usage information should
only be written to stderr if an error condition has occurred, i.e.
if the arguments don't satisfy the syntax requirements of a command.
An explicit request for a help page is not an error condition.

Somewhat more pragmatically phrased: You should be able to catch the
output of "camcontrol help" with your pager.

>How-To-Repeat:

$ camcontrol help | more

>Fix:

src/sbin/camcontrol/:

--- camcontrol.c.orig	Thu Jun 10 18:14:18 1999
+++ camcontrol.c	Wed Jun 23 00:38:24 1999
@@ -2586,7 +2586,7 @@
 void 
 usage(int verbose)
 {
-	fprintf(stderr,
+	fprintf(verbose ? stdout : stderr,
 "usage:  camcontrol <command>  [device id][generic args][command args]\n"
 "        camcontrol devlist    [-v]\n"
 "        camcontrol periphlist [dev_id][-n dev_name] [-u unit]\n"
@@ -2611,7 +2611,7 @@
 "        camcontrol help\n");
 	if (!verbose)
 		return;
-	fprintf(stderr,
+	fprintf(stdout,
 "Specify one of the following options:\n"
 "devlist     list all CAM devices\n"
 "periphlist  list all CAM peripheral drivers attached to a device\n"

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ken 
Responsible-Changed-By: ken 
Responsible-Changed-When: Sun Sep 26 22:57:42 PDT 1999 
Responsible-Changed-Why:  
I wrote camcontrol. 
State-Changed-From-To: open->suspended 
State-Changed-By: ken 
State-Changed-When: Sat Jun 3 15:10:53 PDT 2000 
State-Changed-Why:  
I suppose it took me long enough to do something about this PR, sorry. 

Anyway, this has been fixed in rev 1.24 of camcontrol.c, and I'm putting 
the PR in the suspended state to remind me to merge it to RELENG_4 and 
RELENG_3. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=12358 
State-Changed-From-To: suspended->closed 
State-Changed-By: nbm 
State-Changed-When: Sun Aug 6 10:29:50 PDT 2000 
State-Changed-Why:  
ken MFC'd this in 1.21.2.4 of camcontrol.c 

http://www.freebsd.org/cgi/query-pr.cgi?pr=12358 
State-Changed-From-To: closed->suspended 
State-Changed-By: ken 
State-Changed-When: Sun Aug 6 10:39:44 PDT 2000 
State-Changed-Why:  
Put this back in the suspended state until I can decide whether or not to 
merge it into RELENG_3. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=12358 
State-Changed-From-To: suspended->closed 
State-Changed-By: ken 
State-Changed-When: Fri Aug 9 22:37:32 PDT 2002 
State-Changed-Why:  
Close this one, RELENG_3 is now very ancient. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=12358 
>Unformatted:
