blob: d530b9b770a5aa21f8d1bf755b56e2de8d0178b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
$NetBSD: patch-ad,v 1.1 2008/03/15 05:09:07 bjs Exp $
--- date.c.orig 2008-03-09 06:18:13.000000000 -0400
+++ date.c
@@ -831,13 +832,19 @@ unsigned long approxidate(const char *da
int number = 0;
struct tm tm, now;
struct timeval tv;
+ struct timespec ts;
char buffer[50];
if (parse_date(date, buffer, sizeof(buffer)) > 0)
return strtoul(buffer, NULL, 10);
gettimeofday(&tv, NULL);
+#ifdef __NetBSD__
+ TIMEVAL_TO_TIMESPEC(&tv, &ts);
+ localtime_r(&ts.tv_sec, &tm);
+#else
localtime_r(&tv.tv_sec, &tm);
+#endif
now = tm;
for (;;) {
unsigned char c = *date;
|