summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7713e05)
raw | patch | inline | side by side (parent: 7713e05)
author | Bernd Ahlers <bernd@ba-net.org> | |
Mon, 6 Apr 2009 17:26:37 +0000 (19:26 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 May 2009 05:19:14 +0000 (22:19 -0700) |
According to POSIX, tv_sec is supposed to be a time_t, but OpenBSD
(and FreeBSD, too) defines it to be a long, which triggers a type
mismatch when a pointer to it is given to localtime_r().
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
(and FreeBSD, too) defines it to be a long, which triggers a type
mismatch when a pointer to it is given to localtime_r().
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
date.c | patch | blob | history |
index 1165d30adfa783f7cbaa871e38a1370f9f9c4996..409a17d46424083b62f21e7e278393cee7bfa080 100644 (file)
--- a/date.c
+++ b/date.c
int number = 0;
struct tm tm, now;
struct timeval tv;
+ time_t time_sec;
char buffer[50];
if (parse_date(date, buffer, sizeof(buffer)) > 0)
return strtoul(buffer, NULL, 10);
gettimeofday(&tv, NULL);
- localtime_r(&tv.tv_sec, &tm);
+ time_sec = tv.tv_sec;
+ localtime_r(&time_sec, &tm);
now = tm;
for (;;) {
unsigned char c = *date;