diff options
author | Petr Baudis <pasky@ucw.cz> | 2005-04-13 02:38:44 -0700 |
---|---|---|
committer | Petr Baudis <xpasky@machine> | 2005-04-13 02:38:44 -0700 |
commit | 5ade862839133563d588627f17cde7d4c4f0f6f2 (patch) | |
tree | 2031abe6fdaa115800eb0c5cd66ebf265d17b3c3 /update-cache.c | |
parent | aebb2679085d2ecc4d1c943ecfb2e87c699f00d0 (diff) | |
download | git-5ade862839133563d588627f17cde7d4c4f0f6f2.tar.gz git-5ade862839133563d588627f17cde7d4c4f0f6f2.tar.xz |
[PATCH] nsec portability
It seems like the nsec portability is limited; in particular, older
glibcs (<=2.2.4 at least) don't seem to like it. So access the nsec
fields in struct stat only when -DNSEC.
Signed-off-by: Petr Baudis <pasky@ucw.cz>
Diffstat (limited to 'update-cache.c')
-rw-r--r-- | update-cache.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/update-cache.c b/update-cache.c index 1f87892e3..6d37c55a2 100644 --- a/update-cache.c +++ b/update-cache.c @@ -69,9 +69,13 @@ static int index_fd(const char *path, int namelen, struct cache_entry *ce, int f static void fill_stat_cache_info(struct cache_entry *ce, struct stat *st) { ce->ctime.sec = st->st_ctime; +#ifdef NSEC ce->ctime.nsec = st->st_ctim.tv_nsec; +#endif ce->mtime.sec = st->st_mtime; +#ifdef NSEC ce->mtime.nsec = st->st_mtim.tv_nsec; +#endif ce->st_dev = st->st_dev; ce->st_ino = st->st_ino; ce->st_uid = st->st_uid; |