Re: [PATCH 2/2] better introduction of GIT with USE_NSEC defined
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Mar 5, 2009, 11:55 UTC
- Message-ID
- <49AFBDAD.5040501@viscovery.net>
- In-Reply-To
- <49AF9745.8050207@viscovery.net>
Johannes Sixt schrieb:
Show 11 quoted lines
> Kjetil Barvik schrieb: >> - istate->timestamp.sec = st.st_mtime; >> -#ifdef USE_NSEC >> + istate->timestamp.sec = (unsigned int)st.st_mtime; >> istate->timestamp.nsec = (unsigned int)st.st_mtim.tv_nsec; >> -#else >> - istate->timestamp.nsec = 0; >> -#endif > > Doesn't this break on systems where st_mtime is time_t and st_mtim does > not exist?
Yes, it breaks. You can test this on Linux by commenting out these two lines in git-compat-util.h:
diff --git a/git-compat-util.h b/git-compat-util.h index dcf4127..ab4b615 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -44,8 +44,8 @@ #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */ #endif #define _ALL_SOURCE 1 -#define _GNU_SOURCE 1 -#define _BSD_SOURCE 1 +/*#define _GNU_SOURCE 1*/ +/*#define _BSD_SOURCE 1*/ #include <unistd.h> #include <stdio.h> The result even passes the test suite (as long as I don't merge kb/checkout-optim, of course). -- Hannes