From owner-svn-src-stable-9@FreeBSD.ORG Fri Jan 13 10:54:26 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5E381065676; Fri, 13 Jan 2012 10:54:26 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 754488FC24; Fri, 13 Jan 2012 10:54:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0DAsQBh059121; Fri, 13 Jan 2012 10:54:26 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DAsQO1059119; Fri, 13 Jan 2012 10:54:26 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201131054.q0DAsQO1059119@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 13 Jan 2012 10:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230054 - stable/9/share/man/man9 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 10:54:26 -0000 Author: jh Date: Fri Jan 13 10:54:26 2012 New Revision: 230054 URL: http://svn.freebsd.org/changeset/base/230054 Log: MFC r228358: - Fix markup. - Remove trailing whitespace. MFC r228359: sbuf_data() hasn't returned NULL for overflowed buffers since r71721. MFC r228784: Follow style(9) more closely in the example. Modified: stable/9/share/man/man9/sbuf.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/sbuf.9 ============================================================================== --- stable/9/share/man/man9/sbuf.9 Fri Jan 13 10:21:17 2012 (r230053) +++ stable/9/share/man/man9/sbuf.9 Fri Jan 13 10:54:26 2012 (r230054) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2011 +.Dd December 21, 2011 .Dt SBUF 9 .Os .Sh NAME @@ -117,7 +117,7 @@ defined in .Pp Any errors encountered during the allocation or composition of the string will be latched in the data structure, -making a single error test at the end of the composition +making a single error test at the end of the composition sufficient to determine success or failure of the entire process. .Pp The @@ -391,7 +391,8 @@ function returns the actual string; only works on a finished .Fa sbuf . The -.Fn sbuf_len function returns the length of the string. +.Fn sbuf_len +function returns the length of the string. For an .Fa sbuf with an attached drain, @@ -462,12 +463,8 @@ function returns a non-zero value if the drain error, and zero otherwise. .Pp The -.Fn sbuf_data -and .Fn sbuf_len -functions return -.Dv NULL -and \-1, respectively, if the buffer overflowed. +function returns \-1 if the buffer overflowed. .Pp The .Fn sbuf_copyin @@ -482,7 +479,7 @@ being finished, or returns the error code from the drain if one is attached. .Pp The -.Fn sbuf_finish 3 +.Fn sbuf_finish 3 function (the userland version) will return zero for success and \-1 and set errno on error. .Sh EXAMPLES @@ -498,8 +495,8 @@ TAILQ_FOREACH(foo, &foolist, list) { sbuf_printf(sb, " Address: %s\en", foo->address); sbuf_printf(sb, " Zip: %s\en", foo->zipcode); } -if (sbuf_finish(sb)) /* Check for any and all errors */ - err(1,"Could not generate message"); +if (sbuf_finish(sb) != 0) /* Check for any and all errors */ + err(1, "Could not generate message"); transmit_msg(sbuf_data(sb), sbuf_len(sb)); sbuf_delete(sb); .Ed