From jaakko@saunalahti.fi  Sat Apr  5 15:56:39 2008
Return-Path: <jaakko@saunalahti.fi>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 207AF106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  5 Apr 2008 15:56:39 +0000 (UTC)
	(envelope-from jaakko@saunalahti.fi)
Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111])
	by mx1.freebsd.org (Postfix) with ESMTP id A5ABC8FC1D
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  5 Apr 2008 15:56:38 +0000 (UTC)
	(envelope-from jaakko@saunalahti.fi)
Received: from ws64.jh.dy.fi (GMKDCCCII.dsl.saunalahti.fi [85.76.249.203])
	by gw03.mail.saunalahti.fi (Postfix) with ESMTP id 1693F217286
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  5 Apr 2008 18:56:35 +0300 (EEST)
Received: from ws64.jh.dy.fi (localhost [127.0.0.1])
	by ws64.jh.dy.fi (8.14.2/8.14.2) with ESMTP id m35FuZbO012350
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 5 Apr 2008 18:56:35 +0300 (EEST)
	(envelope-from jaakko@ws64.jh.dy.fi)
Received: (from jaakko@localhost)
	by ws64.jh.dy.fi (8.14.2/8.14.2/Submit) id m35FuZ2U012349;
	Sat, 5 Apr 2008 18:56:35 +0300 (EEST)
	(envelope-from jaakko)
Message-Id: <200804051556.m35FuZ2U012349@ws64.jh.dy.fi>
Date: Sat, 5 Apr 2008 18:56:35 +0300 (EEST)
From: Jaakko Heinonen <jh@saunalahti.fi>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] exit status on fetch(1) manual page
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         122470
>Category:       docs
>Synopsis:       [patch] exit status on fetch(1) manual page
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    murray
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 05 16:00:09 UTC 2008
>Closed-Date:    Fri Jan 09 03:56:50 UTC 2009
>Last-Modified:  Fri Jan 09 03:56:50 UTC 2009
>Originator:     Jaakko Heinonen
>Release:        FreeBSD 7.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD x 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 10:35:36 UTC 2008 root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64


	
>Description:

fetch(1) manual page states that fetch(1) exits with status zero or one:

EXIT STATUS
     The fetch command returns zero on success, or one on failure.  If multi-
     ple URLs are listed on the command line, fetch will attempt to retrieve
     each one of them in turn, and will return zero only if they were all suc-
     cessfully retrieved.

However it's possible that it exits with status other than zero or one:

$ fetch -h foo
usage: fetch [-146AFMPRUadlmnpqrsv] [-N netrc] [-o outputfile]
             [-S bytes] [-B bytes] [-T seconds] [-w seconds]
             [-h host -f file [-c dir] | URL ...]
$ echo $?
64

>How-To-Repeat:
	
>Fix:
--- fetch.1-exit-status.diff begins here ---
Index: fetch.1
===================================================================
RCS file: /home/ncvs/src/usr.bin/fetch/fetch.1,v
retrieving revision 1.68
diff -p -u -r1.68 fetch.1
--- fetch.1	28 Dec 2007 19:47:37 -0000	1.68
+++ fetch.1	8 Mar 2008 16:10:18 -0000
@@ -238,7 +238,7 @@ for a description of additional environm
 .Sh EXIT STATUS
 The
 .Nm
-command returns zero on success, or one on failure.
+command returns zero on success, or non-zero on failure.
 If multiple URLs are listed on the command line,
 .Nm
 will attempt to retrieve each one of them in turn, and will return
--- fetch.1-exit-status.diff ends here ---


>Release-Note:
>Audit-Trail:

From: "Ben Kaduk" <minimarmot@gmail.com>
To: "Jaakko Heinonen" <jh@saunalahti.fi>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: docs/122470: [patch] exit status on fetch(1) manual page
Date: Mon, 7 Apr 2008 22:24:12 -0400

 Hello,
 
 On 4/5/08, Jaakko Heinonen <jh@saunalahti.fi> wrote:
 [snip]
 >  fetch(1) manual page states that fetch(1) exits with status zero or one:
 >
 >  EXIT STATUS
 >      The fetch command returns zero on success, or one on failure.  If multi-
 >      ple URLs are listed on the command line, fetch will attempt to retrieve
 >      each one of them in turn, and will return zero only if they were all suc-
 >      cessfully retrieved.
 >
 >  However it's possible that it exits with status other than zero or one:
 >
 >  $ fetch -h foo
 >  usage: fetch [-146AFMPRUadlmnpqrsv] [-N netrc] [-o outputfile]
 >              [-S bytes] [-B bytes] [-T seconds] [-w seconds]
 >              [-h host -f file [-c dir] | URL ...]
 >  $ echo $?
 >  64
 >
 
 It seems that fetch(1) can also return EX_USAGE when it is not
 invoked as it is expecting; this macro is defined to be 64 in
 /usr/include/sysexits.h
 
 We might as well change the man page to say ``EX_USAGE
 is returned when .Nm is not invoked properly.''
 
 -Ben Kaduk
Responsible-Changed-From-To: freebsd-doc->murray 
Responsible-Changed-By: murray 
Responsible-Changed-When: Mon Dec 15 01:57:39 UTC 2008 
Responsible-Changed-Why:  
I have an outstanding patch to fetch out for review.  I will make this 
change in a follow up submit. 


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

From: "Murray Stokely" <murray.stokely@gmail.com>
To: bug-followup@freebsd.org, jh@saunalahti.fi
Cc:  
Subject: Re: docs/122470: [patch] exit status on fetch(1) manual page
Date: Mon, 15 Dec 2008 21:43:45 -0800

 I have a patch to address this out for review :
 
 http://people.freebsd.org/~murray/patches/fetch-unused-vars-20081215.diff
 
 - Murray
State-Changed-From-To: open->patched 
State-Changed-By: murray 
State-Changed-When: Wed Dec 17 18:00:24 UTC 2008 
State-Changed-Why:  
Instead of the last patch, des suggested just updating the return 
values to 1 as the man page states.  This updated patch was committed 
to HEAD : 

http://people.freebsd.org/~murray/patches/fetch-unused-vars-20081216.diff 

Will MFC in a few weeks to 7.x.  This change will not likely be 
present in the upcoming 7.1 release. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=122470 
State-Changed-From-To: patched->closed 
State-Changed-By: murray 
State-Changed-When: Fri Jan 9 03:56:18 UTC 2009 
State-Changed-Why:  
This change has been merged to 7-stable and will be present in FreeBSD 
7.2.  Thanks for your submission! 


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