summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2016-06-07 01:34:39 +0000
committertedu <tedu@openbsd.org>2016-06-07 01:34:39 +0000
commit2f33c23d0ad574ec557f0877ce6ded5ef50321c7 (patch)
tree12751a3df552dd1d7b9495255feb1173e012d2ec
parentper trending style, add continue to empty loops. (diff)
downloadwireguard-openbsd-2f33c23d0ad574ec557f0877ce6ded5ef50321c7.tar.xz
wireguard-openbsd-2f33c23d0ad574ec557f0877ce6ded5ef50321c7.zip
add a hack to avoid printing the long string format for times in the 70s.
this is usually a result of a timestamp which hasn't been identified as "relative" and decoding them to precise dates long in the past is a distraction. (eagerly awaiting a cleaner, better diff to do the same.)
-rw-r--r--usr.bin/kdump/ktrstruct.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/kdump/ktrstruct.c b/usr.bin/kdump/ktrstruct.c
index 3f85c43a422..0f91dc2caf5 100644
--- a/usr.bin/kdump/ktrstruct.c
+++ b/usr.bin/kdump/ktrstruct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ktrstruct.c,v 1.19 2016/05/22 23:02:28 guenther Exp $ */
+/* $OpenBSD: ktrstruct.c,v 1.20 2016/06/07 01:34:39 tedu Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -147,7 +147,8 @@ print_time(time_t t, int relative, int have_subsec)
} else
printf("%jd", (intmax_t)t);
- if (!relative) {
+ /* 1970s times are probably relative */
+ if (!relative && t > (10 * 365 * 24 * 3600)) {
tm = localtime(&t);
if (tm != NULL) {
(void)strftime(timestr, sizeof(timestr), TIME_FORMAT,