summaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-08-02 16:23:28 +0000
committerJim Meyering <jim@meyering.net>1998-08-02 16:23:28 +0000
commit9fc598725004127814936d8ed86d4c7b7f66b812 (patch)
tree83c6f0618b3ea6f7d1e5ce62a945d01c4bf88ef9 /src/copy.c
parente71d9696d7d917186cf6ee5fc807067e5fa3d5e1 (diff)
downloadcoreutils-9fc598725004127814936d8ed86d4c7b7f66b812.tar.xz
(copy_internal): Compare time stamps with subsecond resolution if available.
Diffstat (limited to 'src/copy.c')
-rw-r--r--src/copy.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/copy.c b/src/copy.c
index cf9f1b259..3be9d3825 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -491,7 +491,7 @@ copy_internal (const char *src_path, const char *dst_path,
return 1;
}
- if (x->update && src_sb.st_mtime <= dst_sb.st_mtime)
+ if (x->update && MTIME_CMP (src_sb, dst_sb) <= 0)
return 0;
}
@@ -818,6 +818,10 @@ copy_internal (const char *src_path, const char *dst_path,
{
struct utimbuf utb;
+ /* There's currently no interface to set file timestamps with
+ better than 1-second resolution, so discard any fractional
+ part of the source timestamp. */
+
utb.actime = src_sb.st_atime;
utb.modtime = src_sb.st_mtime;