Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libutil Document that errno may be used to distinguish b...
details: https://anonhg.NetBSD.org/src/rev/5db8f4fc70ea
branches: trunk
changeset: 784143:5db8f4fc70ea
user: apb <apb%NetBSD.org@localhost>
date: Sat Jan 19 15:28:25 2013 +0000
description:
Document that errno may be used to distinguish between a
non-error result of -1 and an error.
diffstat:
lib/libutil/parsedate.3 | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diffs (39 lines):
diff -r 2273074ab078 -r 5db8f4fc70ea lib/libutil/parsedate.3
--- a/lib/libutil/parsedate.3 Sat Jan 19 15:25:58 2013 +0000
+++ b/lib/libutil/parsedate.3 Sat Jan 19 15:28:25 2013 +0000
@@ -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 @@
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
Home |
Main Index |
Thread Index |
Old Index