git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] 64-bit fix for date.c.

From
Jeff King <peff@peff.net>
Date
Apr 6, 2009, 19:06 UTC
Message-ID
<20090406190657.GC28120@coredump.intra.peff.net>
In-Reply-To
<20090406172637.GA17437@jenna.bytemine.net>
On Mon, Apr 06, 2009 at 07:26:37PM +0200, Bernd Ahlers wrote:
Show 8 quoted lines
> @@ -871,13 +871,15 @@ unsigned long approxidate(const char *date)
>  	struct timeval tv;
> +	time_t time_sec;
> [...]
>  	gettimeofday(&tv, NULL);
> -	localtime_r(&tv.tv_sec, &tm);
> +	time_sec = tv.tv_sec;
> +	localtime_r(&time_sec, &tm);

Hmph. According to POSIX, tv_sec _is_ a time_t. But I see on FreeBSD, also, it is actually a "long". So I think this fix makes sense.

-Peff
Previous: Bernd AhlersNext: Bernd Ahlers
Message 2 of 7 in “64-bit fix for date.c.”
  1. 64-bit fix for date.c.Bernd Ahlers, Apr 6, 2009
  2. Jeff KingApr 6, 2009
  3. Bernd AhlersMay 4, 2009
  4. Jeff KingMay 4, 2009
  5. Junio C HamanoMay 6, 2009
  6. Tony FinchMay 6, 2009
  7. Jeff KingMay 6, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.