summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2010-07-29 18:52:46 +0000
committerRay Lai <ray@cvs.openbsd.org>2010-07-29 18:52:46 +0000
commitc1e84e8a0536c0f47b1f926a96335d366d1a3874 (patch)
tree6abfd3e2ab3360bf151413ac320170ecbec264c9
parent71f6d55ab136089eb07b38addee39fbd504e64a6 (diff)
Replace abort(), fatal(), and errx() with return -1, since date_parse
returns -1 on error. OK nicm
-rw-r--r--usr.bin/cvs/date.y4
-rw-r--r--usr.bin/rcs/date.y6
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/cvs/date.y b/usr.bin/cvs/date.y
index 494af2b3933..3421ebda471 100644
--- a/usr.bin/cvs/date.y
+++ b/usr.bin/cvs/date.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: date.y,v 1.20 2010/07/23 21:46:05 ray Exp $ */
+/* $OpenBSD: date.y,v 1.21 2010/07/29 18:52:45 ray Exp $ */
/*
** Originally written by Steven M. Bellovin <smb@research.att.com> while
@@ -814,7 +814,7 @@ date_parse(const char *p)
if (time(&nowtime) == -1 || !gmtime_r(&nowtime, &gmt) ||
!localtime_r(&nowtime, &tm))
- fatal("date_parse failed");
+ return -1;
tz = difftm(&gmt, &tm) / 60;
diff --git a/usr.bin/rcs/date.y b/usr.bin/rcs/date.y
index 424a0835f7f..6eca12eaacc 100644
--- a/usr.bin/rcs/date.y
+++ b/usr.bin/rcs/date.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: date.y,v 1.8 2010/07/23 21:46:05 ray Exp $ */
+/* $OpenBSD: date.y,v 1.9 2010/07/29 18:52:45 ray Exp $ */
/*
** Originally written by Steven M. Bellovin <smb@research.att.com> while
@@ -525,7 +525,7 @@ ToSeconds(time_t Hours, time_t Minutes, time_t Seconds, MERIDIAN Meridian)
Hours = 0;
return ((Hours + 12) * 60L + Minutes) * 60L + Seconds;
default:
- abort();
+ return (-1);
}
/* NOTREACHED */
}
@@ -819,7 +819,7 @@ date_parse(const char *p)
if (time(&nowtime) == -1 || !gmtime_r(&nowtime, &gmt) ||
!localtime_r(&nowtime, &tm))
- errx(1, "date_parse failed");
+ return -1;
tz = difftm(&gmt, &tm) / 60;