Skip to content

Commit

Permalink
fix compile error when USE_NSEC is defined
Browse files Browse the repository at this point in the history
'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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Kjetil Barvik authored and Junio C Hamano committed Feb 20, 2009
1 parent 36419c8 commit 8cd6192
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builtin-fetch-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 8cd6192

Please sign in to comment.