Merge "acp: Ensure dst mtime always greater or equal to src mtime"

This commit is contained in:
Jean-Baptiste Queru 2010-07-08 09:47:08 -07:00 committed by Android Code Review
commit 7d4ae91e0b
1 changed files with 6 additions and 0 deletions

View File

@ -151,6 +151,12 @@ static int setPermissions(const char* dst, const struct stat* pSrcStat, unsigned
*/
ut.actime = pSrcStat->st_atime;
ut.modtime = pSrcStat->st_mtime;
#ifdef MACOSX_RSRC
if (pSrcStat->st_mtimespec.tv_nsec > 0)
#else
if (pSrcStat->st_mtim.tv_nsec > 0)
#endif
ut.modtime += 1;
if (utime(dst, &ut) != 0) {
DBUG(("--- unable to set timestamps on '%s': %s\n",
dst, strerror(errno)));