From: dosomder Date: Fri, 11 Mar 2016 19:06:17 +0000 (+0100) Subject: Add ST_MTIME_NSEC case to archive_entry_copy_stat X-Git-Tag: v3.1.901a~9^2~15^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F667%2Fhead;p=thirdparty%2Flibarchive.git Add ST_MTIME_NSEC case to archive_entry_copy_stat Android uses st_mtime_nsec --- diff --git a/contrib/android/config/android.h b/contrib/android/config/android.h index 5d2abaa86..d795067a0 100644 --- a/contrib/android/config/android.h +++ b/contrib/android/config/android.h @@ -126,7 +126,7 @@ #define HAVE_STRING_H 1 #define HAVE_STRRCHR 1 #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 -#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 +#define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 #define HAVE_STRUCT_TM_TM_GMTOFF 1 #define HAVE_SYMLINK 1 #define HAVE_SYS_CDEFS_H 1 diff --git a/libarchive/archive_entry_copy_stat.c b/libarchive/archive_entry_copy_stat.c index 37d4d6edb..ac83868e8 100644 --- a/libarchive/archive_entry_copy_stat.c +++ b/libarchive/archive_entry_copy_stat.c @@ -44,6 +44,10 @@ archive_entry_copy_stat(struct archive_entry *entry, const struct stat *st) archive_entry_set_atime(entry, st->st_atime, st->st_atim.tv_nsec); archive_entry_set_ctime(entry, st->st_ctime, st->st_ctim.tv_nsec); archive_entry_set_mtime(entry, st->st_mtime, st->st_mtim.tv_nsec); +#elif HAVE_STRUCT_STAT_ST_MTIME_NSEC + archive_entry_set_atime(entry, st->st_atime, st->st_atime_nsec); + archive_entry_set_ctime(entry, st->st_ctime, st->st_ctime_nsec); + archive_entry_set_mtime(entry, st->st_mtime, st->st_mtime_nsec); #elif HAVE_STRUCT_STAT_ST_MTIME_N archive_entry_set_atime(entry, st->st_atime, st->st_atime_n); archive_entry_set_ctime(entry, st->st_ctime, st->st_ctime_n);