From owner-freebsd-doc@FreeBSD.ORG Thu Jan 28 22:50:11 2010 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9DDB106568B for ; Thu, 28 Jan 2010 22:50:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9D8A78FC27 for ; Thu, 28 Jan 2010 22:50:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o0SMoBsZ035676 for ; Thu, 28 Jan 2010 22:50:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o0SMoBdm035675; Thu, 28 Jan 2010 22:50:11 GMT (envelope-from gnats) Resent-Date: Thu, 28 Jan 2010 22:50:11 GMT Resent-Message-Id: <201001282250.o0SMoBdm035675@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Efstratios Karatzas Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33013106566C for ; Thu, 28 Jan 2010 22:42:31 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 21E038FC0A for ; Thu, 28 Jan 2010 22:42:31 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o0SMgUpp074250 for ; Thu, 28 Jan 2010 22:42:30 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o0SMgUpn074249; Thu, 28 Jan 2010 22:42:30 GMT (envelope-from nobody) Message-Id: <201001282242.o0SMgUpn074249@www.freebsd.org> Date: Thu, 28 Jan 2010 22:42:30 GMT From: Efstratios Karatzas To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: docs/143330: [patch] strtonum(3) does undocumented clobbering of errno X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2010 22:50:11 -0000 >Number: 143330 >Category: docs >Synopsis: [patch] strtonum(3) does undocumented clobbering of errno >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 28 22:50:11 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Efstratios Karatzas >Release: FreeBSD 8.0-STABLE i386 >Organization: >Environment: FreeBSD Eternal_Crusader 8.0-STABLE FreeBSD 8.0-STABLE #0: Thu Jan 21 17:46:20 EET 2010 root@Eternal_Crusader:/usr/obj/usr/src/sys/GENERIC i386 >Description: As noted by commiter Bruce Evans in the pr trail of bin/142911, strtonum() sets errno to 0 when no error is found. Checked the source myself and this seems to be the case. This behavior is undocumented. >How-To-Repeat: >Fix: Take a look at the patch below. I just added this information in the "return value" section of the man page. First time editing a man page, hope this is ok. Patch attached with submission follows: --- strtonum.orig.3 2010-01-29 00:17:25.000000000 +0200 +++ strtonum.3 2010-01-29 00:27:31.000000000 +0200 @@ -84,6 +84,8 @@ .Fa errstr will point to an error message. On success, +.Va errno +is set to 0 and .Fa *errstr will be set to .Dv NULL ; >Release-Note: >Audit-Trail: >Unformatted: