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

[PATCH/RFC v2 1/3] fix compile error when USE_NSEC is defined

From
KBKjetil Barvik <barvik@broadpark.no>
Date
Feb 19, 2009, 20:08 UTC
Message-ID
<42717dc50485756e6153fa07d0b5af2496927f00.1235071656.git.barvik@broadpark.no>
In-Reply-To
<cover.1235071656.git.barvik@broadpark.no>

'struct cache' does not have a 'usec' member, but a 'unsigned int nsec' member. Simmilar 'struct stat' does not have a 'st_mtim.usec' member, and we should instead use 'st_mtim.tv_nsec'.

Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
---
 builtin-fetch-pack.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index 67fb80e..3b210c7 100644
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
@@ -802,14 +802,14 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args,
 
 		mtime.sec = st.st_mtime;
 #ifdef USE_NSEC
-		mtime.usec = st.st_mtim.usec;
+		mtime.nsec = st.st_mtim.tv_nsec;
 #endif
 		if (stat(shallow, &st)) {
 			if (mtime.sec)
 				die("shallow file was removed during fetch");
 		} else if (st.st_mtime != mtime.sec
 #ifdef USE_NSEC
-				|| st.st_mtim.usec != mtime.usec
+				|| st.st_mtim.tv_nsec != mtime.nsec
 #endif
 			  )
 			die("shallow file was changed during fetch");
-- 
1.6.1.349.g99fa5
Previous: Kjetil BarvikNext: Kjetil Barvik
Message 2 of 10 in “git checkout optimisation - part 3”
  1. 0/3 git checkout optimisation - part 3Kjetil Barvik, Feb 19, 2009
  2. 1/3 fix compile error when USE_NSEC is definedKjetil Barvik, Feb 19, 2009
  3. 2/3 make USE_NSEC work as expectedKjetil Barvik, Feb 19, 2009
  4. Junio C HamanoFeb 20, 2009
  5. Kjetil BarvikFeb 20, 2009
  6. Junio C HamanoFeb 21, 2009
  7. 3/3 verify_uptodate(): add ce_uptodate(ce) testKjetil Barvik, Feb 19, 2009
  8. Junio C HamanoFeb 20, 2009
  9. Kjetil BarvikFeb 20, 2009
  10. Sverre RabbelierFeb 20, 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.