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

Re: [PATCH] Create USE_ST_TIMESPEC and turn it on for Darwin

From
Brian Gernhardt <benji@silverinsanity.com>
Date
Mar 8, 2009, 21:21 UTC
Message-ID
<70A401B0-C10D-4B4D-9DCC-D0968CE5EAF7@silverinsanity.com>
In-Reply-To
<7vhc23kaay.fsf@gitster.siamese.dyndns.org>
On Mar 8, 2009, at 4:51 PM, Junio C Hamano wrote:
Show 15 quoted lines
> I think this patch moves things in the right direction, but there are
> other uses of "st_[cm]tim.tv_nsec" that do not use the  
> ST_[CM]TIME_NSEC
> macro.
>
> $ git grep -n -e 'st_[cm]tim\.' --cached -- '*.[ch]'
> builtin-fetch-pack.c:810:				|| st.st_mtim.tv_nsec != mtime.nsec
> git-compat-util.h:396:#define ST_CTIME_NSEC(st) ((unsigned int) 
> ((st).st_ctim.tv_nsec))
> git-compat-util.h:397:#define ST_MTIME_NSEC(st) ((unsigned int) 
> ((st).st_mtim.tv_nsec))
> read-cache.c:207:	if (ce->ce_mtime.nsec != (unsigned int)st- 
> >st_mtim.tv_nsec)
> read-cache.c:209:	if (trust_ctime && ce->ce_ctime.nsec != (unsigned  
> int)st->st_ctim.tv_nsec)

Interesting. I couldn't use git-grep due to other problems, but thought any other tim/timespec issues would have stopped my compilation. Looking at the code, this is because everything other than the #defines in git-compat-util.h are surrounded by USE_NSEC which is not defined on my machine.

However, I noticed another breakage entirely. Namely, that USE_NSEC is not defined anywhere. There's a comment in the Makefile that says "define USE_NSEC below", but there is no code that checks for USE_NSEC and sets the appropriate compiler switch. Trivial patch to follow.

> Probably we should apply the following patch as a fix, and then  
> apply your
> enhancement to support st_[cm]timespec systems?
Your patch looks sane to me.
~~ Brian
Previous: Junio C HamanoNext: Brian Gernhardt
Message 3 of 4 in “Create USE_ST_TIMESPEC and turn it on for Darwin”
  1. Create USE_ST_TIMESPEC and turn it on for DarwinBrian Gernhardt, Mar 8, 2009
  2. Junio C HamanoMar 8, 2009
  3. Brian GernhardtMar 8, 2009
  4. Makefile: Set compiler switch for USE_NSECBrian Gernhardt, Mar 8, 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.