Module Name:    src
Committed By:   apb
Date:           Sat Jan 19 15:28:25 UTC 2013

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

Log Message:
Document that errno may be used to distinguish between a
non-error result of -1 and an error.


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

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

Modified files:

Index: src/lib/libutil/parsedate.3
diff -u src/lib/libutil/parsedate.3:1.11 src/lib/libutil/parsedate.3:1.12
--- src/lib/libutil/parsedate.3:1.11	Fri Apr  6 11:36:04 2012
+++ src/lib/libutil/parsedate.3	Sat Jan 19 15:28:25 2013
@@ -1,4 +1,4 @@
-.\"     $NetBSD: parsedate.3,v 1.11 2012/04/06 11:36:04 wiz Exp $
+.\"     $NetBSD: parsedate.3,v 1.12 2013/01/19 15:28:25 apb Exp $
 .\"
 .\" Copyright (c) 2006 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 20, 2010
+.Dd January 19, 2013
 .Dt PARSEDATE 3
 .Os
 .Sh NAME
@@ -241,8 +241,20 @@ Tue Apr 20 03:06:49 UTC 1993
 returns the number of seconds passed since the Epoch, or
 .Dv \-1
 if the date could not be parsed properly.
+A non-error result of
+.Dv \-1
+can be distinguished from an error by setting
+.Va errno
+to
+.Dv 0
+before calling
+.Fn parsedate ,
+and checking the value of
+.Va errno
+afterwards.
 .Sh SEE ALSO
 .Xr date 1 ,
+.Xr errno 2 ,
 .Xr eeprom 8
 .Sh HISTORY
 The parser used in

Reply via email to