Loading libs/host/CopyFile.c +18 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,22 @@ static bool isSourceNewer(const struct stat* pSrcStat, const struct stat* pDstSt (pSrcStat->st_size != pDstStat->st_size); } /* * Returns true if the source file has high resolution modification * date. Cygwin doesn't support st_mtim in normal build, so always * return false. */ static bool isHiresMtime(const struct stat* pSrcStat) { #ifdef WIN32_EXE return 0; #elif defined(MACOSX_RSRC) return pSrcStat->st_mtimespec.tv_nsec > 0; #else return pSrcStat->st_mtim.tv_nsec > 0; #endif } /* * Returns true if the source and destination files are actually the * same thing. We detect this by checking the inode numbers, which seems Loading Loading @@ -151,6 +167,8 @@ static int setPermissions(const char* dst, const struct stat* pSrcStat, unsigned */ ut.actime = pSrcStat->st_atime; ut.modtime = pSrcStat->st_mtime; if (isHiresMtime(pSrcStat)) ut.modtime += 1; if (utime(dst, &ut) != 0) { DBUG(("--- unable to set timestamps on '%s': %s\n", dst, strerror(errno))); Loading Loading
libs/host/CopyFile.c +18 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,22 @@ static bool isSourceNewer(const struct stat* pSrcStat, const struct stat* pDstSt (pSrcStat->st_size != pDstStat->st_size); } /* * Returns true if the source file has high resolution modification * date. Cygwin doesn't support st_mtim in normal build, so always * return false. */ static bool isHiresMtime(const struct stat* pSrcStat) { #ifdef WIN32_EXE return 0; #elif defined(MACOSX_RSRC) return pSrcStat->st_mtimespec.tv_nsec > 0; #else return pSrcStat->st_mtim.tv_nsec > 0; #endif } /* * Returns true if the source and destination files are actually the * same thing. We detect this by checking the inode numbers, which seems Loading Loading @@ -151,6 +167,8 @@ static int setPermissions(const char* dst, const struct stat* pSrcStat, unsigned */ ut.actime = pSrcStat->st_atime; ut.modtime = pSrcStat->st_mtime; if (isHiresMtime(pSrcStat)) ut.modtime += 1; if (utime(dst, &ut) != 0) { DBUG(("--- unable to set timestamps on '%s': %s\n", dst, strerror(errno))); Loading