* libmisc/copydir.c, configure.in: Check for the presence of
st_mtim and st_mtimensec, as for st_atim and st_atimensec.
This commit is contained in:
@@ -288,19 +288,26 @@ static int copy_entry (const char *src, const char *dst,
|
||||
if (LSTAT (src, &sb) == -1) {
|
||||
/* If we cannot stat the file, do not care. */
|
||||
} else {
|
||||
#ifdef HAVE_STRUCT_STAT_ST_ATIM
|
||||
#ifdef HAVE_STRUCT_STAT_ST_ATIM
|
||||
mt[0].tv_sec = sb.st_atim.tv_sec;
|
||||
mt[0].tv_usec = sb.st_atim.tv_nsec / 1000;
|
||||
#else
|
||||
mt[0].tv_sec = sb.st_atime;
|
||||
#ifdef HAVE_STRUCT_STAT_ST_ATIMENSEC
|
||||
mt[0].tv_usec = sb.st_atimensec / 1000;
|
||||
#else
|
||||
mt[0].tv_usec = 0;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRUCT_STAT_ST_MTIM
|
||||
mt[1].tv_sec = sb.st_mtim.tv_sec;
|
||||
mt[1].tv_usec = sb.st_mtim.tv_nsec / 1000;
|
||||
#else
|
||||
mt[0].tv_sec = sb.st_atime;
|
||||
mt[1].tv_sec = sb.st_mtime;
|
||||
#ifdef HAVE_STRUCT_STAT_ST_ATIMENSEC
|
||||
mt[0].tv_usec = sb.st_atimensec / 1000;
|
||||
#ifdef HAVE_STRUCT_STAT_ST_MTIMENSEC
|
||||
mt[1].tv_usec = sb.st_mtimensec / 1000;
|
||||
#else
|
||||
mt[0].tv_usec = 0;
|
||||
mt[1].tv_usec = 0;
|
||||
#endif
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user