NetBSD Problem Report #43795

From www@NetBSD.org  Tue Aug 24 00:44:36 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id BDAF863BC34
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 24 Aug 2010 00:44:36 +0000 (UTC)
Message-Id: <20100824004436.8EFC563BBEB@www.NetBSD.org>
Date: Tue, 24 Aug 2010 00:44:36 +0000 (UTC)
From: guy@alum.mit.edu
Reply-To: guy@alum.mit.edu
To: gnats-bugs@NetBSD.org
Subject: getmntopts(3) man page doesn't describe return values and error handling well
X-Send-Pr-Version: www-1.0

>Number:         43795
>Category:       misc
>Synopsis:       getmntopts(3) man page doesn't describe return values and error handling well
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 24 00:45:00 +0000 2010
>Closed-Date:    Wed Aug 10 18:48:47 +0000 2011
>Last-Modified:  Wed Aug 10 18:48:47 +0000 2011
>Originator:     Guy Harris
>Release:        netbsd-current
>Organization:
>Environment:
N/A - discovered by looking at the man page
>Description:
The getmntopts(3) man page doesn't describe the return value of getmntopts(), and doesn't describe the error behavior of getmntopts(), getmntoptstr(), or getmntoptnum() very well.  There are also some typoes in the man page.
>How-To-Repeat:
"man getmntopts", or go to the online man page.
>Fix:
I'll try to attach a patch file.

>Release-Note:

>Audit-Trail:
From: Guy Harris <guy@alum.mit.edu>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: misc/43795: getmntopts(3) man page doesn't describe return values and error handling well
Date: Mon, 23 Aug 2010 17:56:48 -0700

 Fix:

 *** ~gharris/src/netbsd/current/lib/libutil/getmntopts.3	=
 2010-08-23 17:10:34.000000000 -0700
 --- ./getmntopts.3	2010-08-23 17:34:23.000000000 -0700
 ***************
 *** 51,57 ****
   The
   .Fn getmntopts
   function takes a comma separated option list and a list
 ! of valid option names, and computes the bitmask
   corresponding to the requested set of options.
   .Pp
   The string
 --- 51,57 ----
   The
   .Fn getmntopts
   function takes a comma separated option list and a list
 ! of valid option names, and computes the bitmasks
   corresponding to the requested set of options.
   .Pp
   The string
 ***************
 *** 141,157 ****
   .Dv NULL
   first element.
   .Pp
   The
   .Fn getmntoptstr
   function returns the string value of the named option, if such a value
 ! was set it the option string.
   .Pp
   The
   .Fn getmntoptnum
 ! returns the long value of the named option, if such a value was set it =
 the
   option string.
 ! It prints an error message and exits if the value was not
 ! set, or could not be converted from a string to a long.
   .Pp
   The
   .Fn freemntopts
 --- 141,199 ----
   .Dv NULL
   first element.
   .Pp
 + .Fn getmntopts
 + returns a
 + .Li "mntoptparse_t"
 + handle that can be used in subsequent
 + .Fn getmntoptstr
 + and
 + .Fn getmntoptnum
 + calls to fetch a value for an option and that must be freed with a =
 call
 + to
 + .Fn freemntopts .
 + If an error occurred, then if the external integer value
 + .Va getmnt_silent
 + is zero then
 + .Fn getmntopts
 + prints an error message and exits;
 + if
 + .Va getmnt_silent
 + is non-zero then
 + .Fn getmntopts
 + returns
 + .Dv NULL .
 + .Pp
   The
   .Fn getmntoptstr
   function returns the string value of the named option, if such a value
 ! was set in the option string.
 ! If the value was not set, then if the external integer value
 ! .Va getmnt_silent
 ! is zero then
 ! .Fn getmntoptstr
 ! prints an error message and exits;
 ! if
 ! .Va getmnt_silent
 ! is non-zero then
 ! .Fn getmntoptstr
 ! returns
 ! .Dv NULL .
   .Pp
   The
   .Fn getmntoptnum
 ! returns the long value of the named option, if such a value was set in =
 the
   option string.
 ! If the value was not set, or could not be converted from a string to a
 ! long, then if the external integer value
 ! .Va getmnt_silent
 ! is zero then
 ! .Fn getmntoptnum
 ! prints an error message and exits;
 ! if
 ! .Va getmnt_silent
 ! is non-zero then
 ! .Fn getmntoptnum
 ! returns \-1.
   .Pp
   The
   .Fn freemntopts
 ***************
 *** 172,178 ****
   .Fn getmntoptstr
   returns
   .Dv NULL
 ! if the option does not have an argument, or the option string.
   .Fn getmntoptnum
   returns \-1 if an error occurred.
   .Sh EXAMPLES
 --- 214,220 ----
   .Fn getmntoptstr
   returns
   .Dv NULL
 ! if an error occurred.
   .Fn getmntoptnum
   returns \-1 if an error occurred.
   .Sh EXAMPLES
 ***************
 *** 214,222 ****
   If the external integer variable
   .Va getmnt_silent
   is zero then the
 ! .Fn getmntopts
 ! function displays an error message and exits if an
 ! unrecognized option is encountered.
   By default
   .Va getmnt_silent
   is zero.
 --- 256,266 ----
   If the external integer variable
   .Va getmnt_silent
   is zero then the
 ! .Fn getmntopts ,
 ! .Fn getmntoptstr ,
 ! and
 ! .Fn getmntoptnum
 ! functions display an error message and exit if an error occurred.
   By default
   .Va getmnt_silent
   is zero.

From: Guy Harris <guy@alum.mit.edu>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: misc/43795: getmntopts(3) man page doesn't describe return values and error handling well
Date: Mon, 23 Aug 2010 18:04:02 -0700

 --Apple-Mail-1--638035697
 Content-Transfer-Encoding: 7bit
 Content-Type: text/plain;
 	charset=us-ascii

 Fix, as an attachment:



 --Apple-Mail-1--638035697
 Content-Disposition: attachment;
 	filename=patch
 Content-Type: application/octet-stream;
 	x-unix-mode=0644;
 	name="patch"
 Content-Transfer-Encoding: 7bit

 *** /Network/Servers/madrid/Volumes/huis/gharris/src/netbsd/current/lib/libutil/getmntopts.3	2010-08-23 17:10:34.000000000 -0700
 --- ./getmntopts.3	2010-08-23 17:34:23.000000000 -0700
 ***************
 *** 51,57 ****
   The
   .Fn getmntopts
   function takes a comma separated option list and a list
 ! of valid option names, and computes the bitmask
   corresponding to the requested set of options.
   .Pp
   The string
 --- 51,57 ----
   The
   .Fn getmntopts
   function takes a comma separated option list and a list
 ! of valid option names, and computes the bitmasks
   corresponding to the requested set of options.
   .Pp
   The string
 ***************
 *** 141,157 ****
   .Dv NULL
   first element.
   .Pp
   The
   .Fn getmntoptstr
   function returns the string value of the named option, if such a value
 ! was set it the option string.
   .Pp
   The
   .Fn getmntoptnum
 ! returns the long value of the named option, if such a value was set it the
   option string.
 ! It prints an error message and exits if the value was not
 ! set, or could not be converted from a string to a long.
   .Pp
   The
   .Fn freemntopts
 --- 141,199 ----
   .Dv NULL
   first element.
   .Pp
 + .Fn getmntopts
 + returns a
 + .Li "mntoptparse_t"
 + handle that can be used in subsequent
 + .Fn getmntoptstr
 + and
 + .Fn getmntoptnum
 + calls to fetch a value for an option and that must be freed with a call
 + to
 + .Fn freemntopts .
 + If an error occurred, then if the external integer value
 + .Va getmnt_silent
 + is zero then
 + .Fn getmntopts
 + prints an error message and exits;
 + if
 + .Va getmnt_silent
 + is non-zero then
 + .Fn getmntopts
 + returns
 + .Dv NULL .
 + .Pp
   The
   .Fn getmntoptstr
   function returns the string value of the named option, if such a value
 ! was set in the option string.
 ! If the value was not set, then if the external integer value
 ! .Va getmnt_silent
 ! is zero then
 ! .Fn getmntoptstr
 ! prints an error message and exits;
 ! if
 ! .Va getmnt_silent
 ! is non-zero then
 ! .Fn getmntoptstr
 ! returns
 ! .Dv NULL .
   .Pp
   The
   .Fn getmntoptnum
 ! returns the long value of the named option, if such a value was set in the
   option string.
 ! If the value was not set, or could not be converted from a string to a
 ! long, then if the external integer value
 ! .Va getmnt_silent
 ! is zero then
 ! .Fn getmntoptnum
 ! prints an error message and exits;
 ! if
 ! .Va getmnt_silent
 ! is non-zero then
 ! .Fn getmntoptnum
 ! returns \-1.
   .Pp
   The
   .Fn freemntopts
 ***************
 *** 172,178 ****
   .Fn getmntoptstr
   returns
   .Dv NULL
 ! if the option does not have an argument, or the option string.
   .Fn getmntoptnum
   returns \-1 if an error occurred.
   .Sh EXAMPLES
 --- 214,220 ----
   .Fn getmntoptstr
   returns
   .Dv NULL
 ! if an error occurred.
   .Fn getmntoptnum
   returns \-1 if an error occurred.
   .Sh EXAMPLES
 ***************
 *** 214,222 ****
   If the external integer variable
   .Va getmnt_silent
   is zero then the
 ! .Fn getmntopts
 ! function displays an error message and exits if an
 ! unrecognized option is encountered.
   By default
   .Va getmnt_silent
   is zero.
 --- 256,266 ----
   If the external integer variable
   .Va getmnt_silent
   is zero then the
 ! .Fn getmntopts ,
 ! .Fn getmntoptstr ,
 ! and
 ! .Fn getmntoptnum
 ! functions display an error message and exit if an error occurred.
   By default
   .Va getmnt_silent
   is zero.

 --Apple-Mail-1--638035697--

From: Robert Elz <kre@munnari.OZ.AU>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: misc/43795: getmntopts(3) man page doesn't describe return values and error handling well
Date: Tue, 24 Aug 2010 17:04:27 +0700

     Date:        Tue, 24 Aug 2010 02:25:02 +0000 (UTC)
     From:        Guy Harris <guy@alum.mit.edu>
     Message-ID:  <20100824022502.48EE663BBEB@www.NetBSD.org>


   |  *** 141,157 ****
   |    .Dv NULL
   |    first element.
   |    .Pp
   |    The
   |    .Fn getmntoptstr
   |    function returns the string value of the named option, if such a value
   |  ! was set it the option string.
   |    .Pp
   |    The
   |    .Fn getmntoptnum
   |  ! returns the long value of the named option, if such a value was set it the
   |    option string.
   |  ! It prints an error message and exits if the value was not
   |  ! set, or could not be converted from a string to a long.
   |    .Pp
   |    The
   |    .Fn freemntopts

 Surely s/it/in/   (in both the old and new versions - ie: this is an
 old typo that didn't get corrected).

 or to be more precise
 	s/set it the option string/set in the option string/

 kre

From: Christos Zoulas <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43795 CVS commit: src/lib/libutil
Date: Tue, 24 Aug 2010 08:05:01 -0400

 Module Name:	src
 Committed By:	christos
 Date:		Tue Aug 24 12:05:01 UTC 2010

 Modified Files:
 	src/lib/libutil: getmntopts.3

 Log Message:
 PR/43795: Guy Harris: describe return values and error handling.


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.12 src/lib/libutil/getmntopts.3

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Wed, 25 Aug 2010 05:18:48 +0000
State-Changed-Why:
christos committed a version of this -- fine now?


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Wed, 10 Aug 2011 18:48:47 +0000
State-Changed-Why:
Feedback timeout; Christos committed it nearly a year ago.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.