From 64cac26a04d962b0c7a270fe049c42cd6c093886 Mon Sep 17 00:00:00 2001 From: ray Date: Thu, 29 Jul 2010 18:52:45 +0000 Subject: [PATCH] Replace abort(), fatal(), and errx() with return -1, since date_parse returns -1 on error. OK nicm --- usr.bin/cvs/date.y | 4 ++-- usr.bin/rcs/date.y | 6 +++--- 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 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 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; -- 2.20.1