From nobody@FreeBSD.org  Wed Dec  6 10:36:05 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id DB1FC16A4FF
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  6 Dec 2006 10:36:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.FreeBSD.org (Postfix) with ESMTP id BAA1344764
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  6 Dec 2006 10:10:54 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id kB6AANUx041949
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 6 Dec 2006 10:10:23 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id kB6AANf8041948;
	Wed, 6 Dec 2006 10:10:23 GMT
	(envelope-from nobody)
Message-Id: <200612061010.kB6AANf8041948@www.freebsd.org>
Date: Wed, 6 Dec 2006 10:10:23 GMT
From: Guy Harris<guy@alum.mit.edu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: getconf needs to check for 0, not -1, when checking for confstr errors
X-Send-Pr-Version: www-3.0

>Number:         106414
>Category:       bin
>Synopsis:       getconf(1) needs to check for 0, not -1, when checking for confstr errors
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 06 10:40:02 GMT 2006
>Closed-Date:    Wed Dec 13 12:32:41 GMT 2006
>Last-Modified:  Wed Dec 13 12:32:41 GMT 2006
>Originator:     Guy Harris
>Release:        7.0-CURRENT
>Organization:
>Environment:
>Description:
In FreeBSD, confstr() has returned 0, rather than -1, on all errors for a
while (that's the behavior the Single UNIX Specification requires); the
documentation was recently fixed to reflect that.

As was pointed out in a response to a bug I filed on confstr() returning -1
in a different BSD, the getconf command needs to be changed to check for 0,
not -1, in its confstr() call.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: maxim 
State-Changed-When: Wed Dec 6 12:00:52 UTC 2006 
State-Changed-Why:  
Fixed in HEAD.  Thanks for the report. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/106414: commit references a PR
Date: Wed,  6 Dec 2006 12:03:12 +0000 (UTC)

 maxim       2006-12-06 12:00:26 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.bin/getconf      getconf.c 
   Log:
   o confstr(3) returns 0 on error.  Check the return value accordingly.
   
   PR:             misc/106414
   MFC after:      1 week
   
   Revision  Changes    Path
   1.10      +10 -6     src/usr.bin/getconf/getconf.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: maxim 
State-Changed-When: Wed Dec 13 12:32:27 UTC 2006 
State-Changed-Why:  
Merged to RELENG_6. 

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