summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2006-03-10 11:51:20 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2006-03-10 11:51:20 +0000
commit7a8317d39d0281ff69e9f567f4c5dc11eaee7e87 (patch)
treeb863045a56813e698742af31e8d73f9730455643 /usr.bin
parenta7de11cae61794e801e0976e32c898e36dd217fa (diff)
use same date format as gnu/usr.bin/rcs in error message. OK niallo@.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/rcs/ci.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c
index e6894808a54..77161f36092 100644
--- a/usr.bin/rcs/ci.c
+++ b/usr.bin/rcs/ci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ci.c,v 1.112 2006/03/08 20:19:39 joris Exp $ */
+/* $OpenBSD: ci.c,v 1.113 2006/03/10 11:51:19 xsa Exp $ */
/*
* Copyright (c) 2005, 2006 Niall O'Higgins <niallo@openbsd.org>
* All rights reserved.
@@ -480,19 +480,19 @@ checkin_update(struct checkin_params *pb)
if (pb->date != DATE_NOW) {
time_t head_date = rcs_rev_getdate(pb->file, pb->frev);
if (pb->date <= head_date) {
- char *head_date_str, *tdate;
- head_date_str = xstrdup(ctime(&head_date));
- head_date_str[strlen(head_date_str) - 1] = '\0';
- tdate = xstrdup(ctime(&pb->date));
- tdate[strlen(tdate) - 1] = '\0';
- cvs_log(LP_ERR,
- "%s: Date %s preceeds %s in revision %s",
- pb->file->rf_path, tdate, head_date_str,
+ char dbuf1[256], dbuf2[256], *fmt;
+ struct tm *t, *t_head;
+
+ fmt = "%Y/%m/%d %H:%M:%S";
+
+ t = localtime(&pb->date);
+ strftime(dbuf1, sizeof(dbuf1), fmt, t);
+ t_head = localtime(&head_date);
+ strftime(dbuf2, sizeof(dbuf2), fmt, t_head);
+
+ fatal("%s: Date %s preceeds %s in revision %s.",
+ pb->file->rf_path, dbuf1, dbuf2,
rcsnum_tostr(pb->frev, numb2, sizeof(numb2)));
- rcs_close(pb->file);
- xfree(head_date_str);
- xfree(tdate);
- return (-1);
}
}